use global, kinda ugly but ehhh...
This commit is contained in:
parent
2acabbfb8d
commit
890f080dbc
1 changed files with 5 additions and 0 deletions
|
@ -17,12 +17,17 @@ class Runnable:
|
|||
await self.stop(force=True)
|
||||
|
||||
def run(self):
|
||||
global DONE
|
||||
global FORCE_QUIT
|
||||
|
||||
logging.info("Starting process")
|
||||
|
||||
DONE = asyncio.Event()
|
||||
FORCE_QUIT = asyncio.Event()
|
||||
|
||||
def signal_handler(signum, __):
|
||||
global DONE
|
||||
global FORCE_QUIT
|
||||
if signum == SIGINT:
|
||||
if DONE.is_set():
|
||||
logging.info("Received SIGINT, terminating")
|
||||
|
|
Loading…
Reference in a new issue