changeset 8:e3d8b5bfdc11 draft default tip

Uploaded
author greg
date Thu, 15 Jul 2021 20:34:30 +0000
parents 75ae6c480918
children
files update_stag_database.py
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/update_stag_database.py	Mon Jan 18 13:52:55 2021 +0000
+++ b/update_stag_database.py	Thu Jul 15 20:34:30 2021 +0000
@@ -6,6 +6,7 @@
 import os
 import subprocess
 import sys
+import threading
 
 import dateutil.parser
 
@@ -700,5 +701,15 @@
 
 if __name__ == '__main__':
     sdu = StagDatabaseUpdater()
-    sdu.run()
+    lock = threading.Lock()
+    lock.acquire(True)
+    try:
+        sdu.run()
+    except Exception as e:
+        print("Exception updating the stag database:\n%s\n" % str(e))
+        print("\nProcessing ended in error...\n")
+        lock.release()
+        sys.exit(1)
+    finally:
+        lock.release()
     sdu.shutdown()