new alarm mechanism
This commit is contained in:
@@ -4,9 +4,13 @@ import subprocess, sys, signal
|
||||
from pathlib import Path
|
||||
|
||||
d = Path(__file__).parent
|
||||
|
||||
# Forward any CLI args (e.g. --config) to contents_server
|
||||
extra_args = sys.argv[1:]
|
||||
|
||||
procs = [
|
||||
subprocess.Popen([sys.executable, d / "stats_server.py"]),
|
||||
subprocess.Popen([sys.executable, d / "contents_server.py"]),
|
||||
subprocess.Popen([sys.executable, d / "contents_server.py"] + extra_args),
|
||||
]
|
||||
signal.signal(signal.SIGINT, lambda *_: [p.terminate() for p in procs])
|
||||
signal.signal(signal.SIGTERM, lambda *_: [p.terminate() for p in procs])
|
||||
|
||||
Reference in New Issue
Block a user