Make daemon start instantly when not started in background

This commit is contained in:
Bernd Schoolmann 2023-12-23 13:44:41 +01:00
parent f68dd3e973
commit 0136dac008
No known key found for this signature in database
1 changed files with 5 additions and 2 deletions

View File

@ -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()