From 11f0c41e904b5c0b3fb28280c4801ed436848759 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 25 Oct 2019 18:25:44 +0200 Subject: [PATCH] crash all server if mongo error happened --- pype/ftrack/ftrack_server/event_server_cli.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pype/ftrack/ftrack_server/event_server_cli.py b/pype/ftrack/ftrack_server/event_server_cli.py index 6796399ad8..a016f1aaf4 100644 --- a/pype/ftrack/ftrack_server/event_server_cli.py +++ b/pype/ftrack/ftrack_server/event_server_cli.py @@ -225,6 +225,10 @@ def main_loop(ftrack_url, username, api_key, event_paths): # If thread failed test Ftrack and Mongo connection elif not storer_thread.isAlive(): + if storer_thread.mongo_error: + raise Exception( + "Exiting because have issue with acces to MongoDB" + ) storer_thread.join() storer_thread = None ftrack_accessible = False @@ -237,7 +241,11 @@ def main_loop(ftrack_url, username, api_key, event_paths): processor_thread.start() # If thread failed test Ftrack and Mongo connection - elif processor_thread.isAlive(): + elif not processor_thread.isAlive(): + if storer_thread.mongo_error: + raise Exception( + "Exiting because have issue with acces to MongoDB" + ) processor_thread.join() processor_thread = None ftrack_accessible = False