1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2024-12-05 02:31:33 +00:00

Replace cleanup() with stop()

This commit is contained in:
R. Richard 2019-05-20 11:09:27 +02:00
parent d33ba34454
commit a1b4a87864
2 changed files with 8 additions and 8 deletions

View File

@ -151,12 +151,12 @@ def main():
terminal.historymonitor.subscribe_callback(cenator)
event_handlers = EventHandlerBase.get_local_instances()
def cleanup(sig, frame):
def stop(sig, frame):
for eh in event_handlers:
eh.cleanup()
eh.stop()
exit(0)
signal(SIGTERM, cleanup)
signal(SIGINT, cleanup)
signal(SIGTERM, stop)
signal(SIGINT, stop)
IOLoop.instance().start()

View File

@ -14,11 +14,11 @@ if __name__ == '__main__':
)
event_handlers = EventHandlerBase.get_local_instances()
def cleanup(sig, frame):
def stop(sig, frame):
for eh in event_handlers:
eh.cleanup()
eh.stop()
exit(0)
signal(SIGTERM, cleanup)
signal(SIGINT, cleanup)
signal(SIGTERM, stop)
signal(SIGINT, stop)
IOLoop.instance().start()