use one variable to track app shutdown state
This commit is contained in:
parent
0cc3a4523e
commit
567952d91d
7 changed files with 35 additions and 44 deletions
|
|
@ -60,8 +60,12 @@ def log_request(handler):
|
|||
handler._request_summary(), request_time)
|
||||
|
||||
def shutdown():
|
||||
state.shutdown = True
|
||||
if state.tor:
|
||||
state.tor._shutdown = True
|
||||
if state.nodes:
|
||||
logger.debug('shutdown nodes')
|
||||
state.nodes.join()
|
||||
if state.downloads:
|
||||
logger.debug('shutdown downloads')
|
||||
state.downloads.join()
|
||||
|
|
@ -70,9 +74,6 @@ def shutdown():
|
|||
if state.tasks:
|
||||
logger.debug('shutdown tasks')
|
||||
state.tasks.join()
|
||||
if state.nodes:
|
||||
logger.debug('shutdown nodes')
|
||||
state.nodes.join()
|
||||
if state.node:
|
||||
state.node.stop()
|
||||
if state.tor:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue