1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2025-07-14 01:06:23 +00:00

Use new EventHandlerBase API to simplify graceful stop logic

This commit is contained in:
Kristóf Tóth
2019-07-01 16:02:44 +02:00
parent d263011179
commit 76118c0c49
2 changed files with 11 additions and 21 deletions

View File

@ -165,10 +165,8 @@ def main():
key='test'
)
event_handlers = EventHandler.get_local_instances()
def stop(sig, frame): # pylint: disable=unused-argument
for eh in event_handlers:
eh.stop()
def stop(*_):
EventHandler.stop_all_instances()
exit(0)
signal(SIGTERM, stop)
signal(SIGINT, stop)