[wallet server] stop executor after stopping server and wait for shutdown event

This commit is contained in:
Victor Shyba 2019-01-25 18:30:19 -03:00 committed by Lex Berezhny
parent 662f2bff4c
commit 9d3e1af69b

View file

@ -126,8 +126,9 @@ class Server:
loop.add_signal_handler(signal.SIGINT, __exit)
loop.add_signal_handler(signal.SIGTERM, __exit)
loop.run_until_complete(self.start())
loop.run_until_complete(self.shutdown_event.wait())
except (SystemExit, KeyboardInterrupt):
pass
finally:
executor.shutdown(True)
loop.run_until_complete(self.stop())
executor.shutdown(True)