Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

np-api-server auto exit #1021

Merged
merged 7 commits into from
Sep 30, 2019

Conversation

jseagrave21
Copy link
Contributor

@jseagrave21 jseagrave21 commented Sep 22, 2019

What current issue(s) does this address, or what feature is it adding?
Partially addresses #1020, specifically issues 1-3. Now, the program will automatically exit whenever an issue arises when opening a wallet or setting minpeers/maxpeers.

I haven't figured out how to solve issue 4 from #1020.

(-edit-) All issues from #1020 have been addressed thanks to input from @ixje

How did you solve this problem?
I replaced applicable instances of return with raise SystemExit which had precedence for issues setting port-rpc and port-rest.

How did you make sure your solution works?
Manual testing

Are there any special changes in the code that we should be aware of?
No.

Please check the following, if applicable:

  • Did you add any tests?
  • Did you run make lint?
  • Did you run make test?
  • Are you making a PR to a feature branch or development rather than master?
  • Did you add an entry to CHANGELOG.rst? (if not, please do)

jseagrave21 added 2 commits September 21, 2019 17:12
- for all return cases when setting minpeers and maxpeers
- for all return cases when opening a wallet
@coveralls
Copy link

coveralls commented Sep 22, 2019

Coverage Status

Coverage remained the same at 85.313% when pulling 510a1cc on jseagrave21:np-api-server-auto-exit into 70ded9e on CityOfZion:development.

@jseagrave21 jseagrave21 force-pushed the np-api-server-auto-exit branch from cbfd58a to 282c881 Compare September 22, 2019 02:09
@ixje
Copy link
Member

ixje commented Sep 23, 2019

Can you please include the fix from this #1020 (comment) into your PR?

@ixje
Copy link
Member

ixje commented Sep 23, 2019

Issue 4 can be solved by changing

runner = web.AppRunner(api_server_rpc.app)

to

runner = web.AppRunner(api_server_rpc.app, handle_signals=True)

Note: it will not shutdown instantly but will do it asynchronously. We can't seem to control that. It's up to the aiohttp package when it decides to run the handlers shrug

-edit-
don't forget to also apply the above fix to line 285

@jseagrave21
Copy link
Contributor Author

jseagrave21 commented Sep 23, 2019

Can you please include the fix from this #1020 (comment) into your PR?
don't forget to also apply the above fix to line 285

@ixje will do. Thank you!

jseagrave21 added 4 commits September 23, 2019 23:19
- housekeeping
- restore warning in case privatenet database is different from the one you're connecting to (e.g. because you restarted your docker image or single node)
@ixje
Copy link
Member

ixje commented Sep 30, 2019

💯

@ixje ixje merged commit cc6fd89 into CityOfZion:development Sep 30, 2019
@jseagrave21 jseagrave21 deleted the np-api-server-auto-exit branch September 30, 2019 06:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants