ops forgot to check signum
This commit is contained in:
parent
021d35be6a
commit
2acabbfb8d
1 changed files with 8 additions and 7 deletions
|
@ -22,13 +22,14 @@ class Runnable:
|
|||
DONE = asyncio.Event()
|
||||
FORCE_QUIT = asyncio.Event()
|
||||
|
||||
def signal_handler():
|
||||
if DONE.is_set():
|
||||
logging.info("Received SIGINT, terminating")
|
||||
FORCE_QUIT.set()
|
||||
else:
|
||||
logging.info("Received SIGINT, stopping gracefully...")
|
||||
DONE.set()
|
||||
def signal_handler(signum, __):
|
||||
if signum == SIGINT:
|
||||
if DONE.is_set():
|
||||
logging.info("Received SIGINT, terminating")
|
||||
FORCE_QUIT.set()
|
||||
else:
|
||||
logging.info("Received SIGINT, stopping gracefully...")
|
||||
DONE.set()
|
||||
|
||||
signal(SIGINT, signal_handler)
|
||||
|
||||
|
|
Loading…
Reference in a new issue