From 0136dac0086f3731785730e85677a0b1aa4b754a Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Sat, 23 Dec 2023 13:44:41 +0100 Subject: [PATCH] Make daemon start instantly when not started in background --- ui/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/main.py b/ui/main.py index 627dccd..a2c6c91 100644 --- a/ui/main.py +++ b/ui/main.py @@ -12,7 +12,9 @@ try: except: pass -if "--hidden" not in sys.argv: +is_hidden = "--hidden" in sys.argv + +if not is_hidden: try: subprocess.Popen(["python3", "/app/bin/settings.py"], start_new_session=True) except: @@ -25,7 +27,8 @@ except: def run_daemon(): # todo: do a proper check - time.sleep(20) + if is_hidden: + time.sleep(20) if not goldwarden.is_daemon_running(): goldwarden.run_daemon()