From 87d5b6c4734a07782267d035b6c7127381275104 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 8 Oct 2019 19:14:23 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jms | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/jms b/jms index bb5608a51..ff949e2d5 100755 --- a/jms +++ b/jms @@ -100,7 +100,7 @@ def collect_static(): os.chdir(os.path.join(BASE_DIR, 'apps')) command = 'python3 manage.py collectstatic --no-input -c &> /dev/null ' subprocess.call(command, shell=True) - logging.info("Collect static file done") + logging.info("Collect static files done") def prepare(): @@ -292,11 +292,12 @@ def watch_services(): p.wait(timeout=1) except subprocess.TimeoutExpired: pass - if p.returncode is not None: + ok = is_running(s) + if not ok: stopped_services[s] = '' - print("stopped") + print("stopped with code: {}({})".format(p.returncode, p.pid)) else: - print("running") + print("running at {}".format(p.pid)) stopped_services.pop(s, None) services_retry.pop(s, None) @@ -320,7 +321,10 @@ def watch_services(): if tm != '23:59': return suffix = now.strftime('%Y-%m-%d') - for s in processes: + services = list(processes.keys()) + services.append('jms') + + for s in services: log_path = get_log_file_path(s) log_dir = os.path.dirname(log_path) filename = os.path.basename(log_path)