more debugging

This commit is contained in:
j 2015-11-19 18:40:42 +01:00
commit cc258fb5ee
2 changed files with 6 additions and 5 deletions

View file

@ -118,15 +118,21 @@ def run():
def shutdown():
if state.downloads:
logger.debug('shutdown downloads')
state.downloads.join()
if state.scraping:
logger.debug('shutdown scraping')
state.scraping.join()
logger.debug('shutdown http_server')
http_server.stop()
if state.tasks:
logger.debug('shutdown tasks')
state.tasks.join()
if state.nodes:
logger.debug('shutdown nodes')
state.nodes.join()
if PID and os.path.exists(PID):
logger.debug('remove %s', PID)
os.unlink(PID)
signal.signal(signal.SIGTERM, shutdown)