From 24175a258766959de53dcc6fc2ffbee0f964847d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 25 Oct 2019 18:22:28 +0200 Subject: [PATCH] atexit register has args now --- pype/ftrack/ftrack_server/event_server_cli.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pype/ftrack/ftrack_server/event_server_cli.py b/pype/ftrack/ftrack_server/event_server_cli.py index 815af50c5a..6796399ad8 100644 --- a/pype/ftrack/ftrack_server/event_server_cli.py +++ b/pype/ftrack/ftrack_server/event_server_cli.py @@ -166,7 +166,7 @@ def main_loop(ftrack_url, username, api_key, event_paths): printed_mongo_error = False # stop threads on exit - def on_exit(): + def on_exit(processor_thread, storer_thread): if processor_thread is not None: processor_thread.stop() processor_thread.join() @@ -177,7 +177,9 @@ def main_loop(ftrack_url, username, api_key, event_paths): storer_thread.join() storer_thread = None - atexit.register(on_exit) + atexit.register( + on_exit, processor_thread=processor_thread, storer_thread=storer_thread + ) # Main loop while True: # Check if accessible Ftrack and Mongo url