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:
@ -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)
|
||||
|
Reference in New Issue
Block a user