From 503d0b33d074cf09d928d945cfff5c89ac9dd7d4 Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Tue, 22 Oct 2019 19:54:04 +0530 Subject: [PATCH] shutdown quality fixes --- src/shutdown.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shutdown.py b/src/shutdown.py index 85d11d67..1d40a90f 100644 --- a/src/shutdown.py +++ b/src/shutdown.py @@ -1,3 +1,4 @@ +"""shutdown function""" import os import Queue import threading @@ -15,8 +16,7 @@ from queues import ( def doCleanShutdown(): - # Used to tell proof of work worker threads - # and the objectProcessorThread to exit. + """Used to tell proof of work worker threads and the objectProcessorThread to exit.""" state.shutdown = 1 objectProcessorQueue.put(('checkShutdownVariable', 'no data')) @@ -53,7 +53,7 @@ def doCleanShutdown(): for thread in threading.enumerate(): if (thread is not threading.currentThread() and - isinstance(thread, StoppableThread) and + isinstance(thread, StoppableThread) and thread.name != 'SQL'): logger.debug("Waiting for thread %s", thread.name) thread.join() @@ -76,10 +76,10 @@ def doCleanShutdown(): except Queue.Empty: break - if shared.thisapp.daemon or not state.enableGUI: # FIXME redundant? + if shared.thisapp.daemon or not state.enableGUI: # ..fixme:: redundant? logger.info('Clean shutdown complete.') shared.thisapp.cleanup() - os._exit(0) + os._exit(0) # pylint: disable=protected-access else: logger.info('Core shutdown complete.') for thread in threading.enumerate():