Make daemon start instantly when not started in background
This commit is contained in:
parent
f68dd3e973
commit
0136dac008
1 changed files with 5 additions and 2 deletions
|
|
@ -12,7 +12,9 @@ try:
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if "--hidden" not in sys.argv:
|
is_hidden = "--hidden" in sys.argv
|
||||||
|
|
||||||
|
if not is_hidden:
|
||||||
try:
|
try:
|
||||||
subprocess.Popen(["python3", "/app/bin/settings.py"], start_new_session=True)
|
subprocess.Popen(["python3", "/app/bin/settings.py"], start_new_session=True)
|
||||||
except:
|
except:
|
||||||
|
|
@ -25,7 +27,8 @@ except:
|
||||||
|
|
||||||
def run_daemon():
|
def run_daemon():
|
||||||
# todo: do a proper check
|
# todo: do a proper check
|
||||||
time.sleep(20)
|
if is_hidden:
|
||||||
|
time.sleep(20)
|
||||||
if not goldwarden.is_daemon_running():
|
if not goldwarden.is_daemon_running():
|
||||||
goldwarden.run_daemon()
|
goldwarden.run_daemon()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue