From 98e9b28bae17088ba035f3fe560787d909eec4ed Mon Sep 17 00:00:00 2001 From: Mabe Date: Wed, 23 Sep 2026 20:53:42 -0700 Subject: [PATCH] Remove migration_status.flag on exit and during initialization; log any exceptions --- cli.py | 1 + main.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cli.py b/cli.py index 642f22c..c687842 100644 --- a/cli.py +++ b/cli.py @@ -129,6 +129,7 @@ def exit_programm(): print("") print("Disconnect DB") print("logout") + os.remove("migration_status.flag") print("shutting down") time.sleep(0.75) os.system('cls' if os.name == 'nt' else 'clear') diff --git a/main.py b/main.py index f7918bd..6cf689a 100644 --- a/main.py +++ b/main.py @@ -29,6 +29,10 @@ except Exception as e: env = os.environ.copy() env["PYTHONIOENCODING"] = "utf-8" +try: + os.remove("migration_status.flag") +except Exception as e: + logging.info(e) #migration def run_migration(): global migration_done @@ -58,9 +62,6 @@ cli_process = subprocess.Popen([sys.executable, "cli.py"]) api_process.wait() cli_process.wait() -time.sleep(60) -os.remove("migration_status.flag") - # automatic durataion validation check while True: time.sleep(300)