From 04947cb97dd38955037e3c774b4ae23e89262144 Mon Sep 17 00:00:00 2001 From: krateng Date: Sun, 27 Mar 2022 22:03:46 +0200 Subject: [PATCH] Switched to explicit server execution --- maloja/proccontrol/control.py | 3 ++- maloja/proccontrol/supervisor.py | 9 +-------- maloja/server.py | 4 ---- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/maloja/proccontrol/control.py b/maloja/proccontrol/control.py index e95acb5..52f1090 100644 --- a/maloja/proccontrol/control.py +++ b/maloja/proccontrol/control.py @@ -10,6 +10,7 @@ from .setup import setup from . import tasks from .. import __pkginfo__ as info from .. import globalconf +from .. import server def print_header_info(): @@ -87,7 +88,7 @@ def onlysetup(): def direct(): print_header_info() setup() - from .. import server + server.run_server() def debug(): os.environ["MALOJA_DEV_MODE"] = 'true' diff --git a/maloja/proccontrol/supervisor.py b/maloja/proccontrol/supervisor.py index 5bf865b..f1ab668 100644 --- a/maloja/proccontrol/supervisor.py +++ b/maloja/proccontrol/supervisor.py @@ -14,17 +14,10 @@ from .control import getInstance setproctitle.setproctitle("maloja_supervisor") -def update(): - log("Updating...",module="supervisor") - try: - os.system("pip3 install maloja --upgrade --no-cache-dir") - except: - log("Could not update.",module="supervisor") - def start(): try: return subprocess.Popen( - ["python3", "-m", "maloja.server"], + ["python3", "-m", "maloja","run"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, ) diff --git a/maloja/server.py b/maloja/server.py index 3b57543..e4800d3 100644 --- a/maloja/server.py +++ b/maloja/server.py @@ -310,7 +310,3 @@ def run_server(): except OSError: log("Error. Is another Maloja process already running?") raise - - - -run_server()