From 78c6c9f0e1bd9d4a37fb4a26f2fa13c6491d6e51 Mon Sep 17 00:00:00 2001 From: vapao Date: Thu, 7 May 2020 18:13:55 +0800 Subject: [PATCH] =?UTF-8?q?U=20=E4=BC=98=E5=8C=96=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_api/tools/start-api.sh | 4 +++- spug_api/tools/start-monitor.sh | 4 +++- spug_api/tools/start-scheduler.sh | 4 +++- spug_api/tools/start-worker.sh | 4 +++- spug_api/tools/start-ws.sh | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/spug_api/tools/start-api.sh b/spug_api/tools/start-api.sh index adb5b96..8f8df53 100644 --- a/spug_api/tools/start-api.sh +++ b/spug_api/tools/start-api.sh @@ -5,5 +5,7 @@ # start api service cd $(dirname $(dirname $0)) -source ./venv/bin/activate +if [ -f ./venv/bin/activate ]; then + source ./venv/bin/activate +fi exec gunicorn -b 127.0.0.1:9001 -w 2 --threads 8 --access-logfile - spug.wsgi diff --git a/spug_api/tools/start-monitor.sh b/spug_api/tools/start-monitor.sh index 5194947..ef52f1c 100644 --- a/spug_api/tools/start-monitor.sh +++ b/spug_api/tools/start-monitor.sh @@ -5,5 +5,7 @@ # start monitor service cd $(dirname $(dirname $0)) -source ./venv/bin/activate +if [ -f ./venv/bin/activate ]; then + source ./venv/bin/activate +fi exec python manage.py runmonitor diff --git a/spug_api/tools/start-scheduler.sh b/spug_api/tools/start-scheduler.sh index 37094a5..7e220e1 100644 --- a/spug_api/tools/start-scheduler.sh +++ b/spug_api/tools/start-scheduler.sh @@ -5,5 +5,7 @@ # start schedule service cd $(dirname $(dirname $0)) -source ./venv/bin/activate +if [ -f ./venv/bin/activate ]; then + source ./venv/bin/activate +fi exec python manage.py runscheduler diff --git a/spug_api/tools/start-worker.sh b/spug_api/tools/start-worker.sh index a799f7d..f8c43fd 100644 --- a/spug_api/tools/start-worker.sh +++ b/spug_api/tools/start-worker.sh @@ -5,5 +5,7 @@ # start worker service cd $(dirname $(dirname $0)) -source ./venv/bin/activate +if [ -f ./venv/bin/activate ]; then + source ./venv/bin/activate +fi exec python manage.py runworker ssh_exec diff --git a/spug_api/tools/start-ws.sh b/spug_api/tools/start-ws.sh index c8889a8..f30c3ba 100644 --- a/spug_api/tools/start-ws.sh +++ b/spug_api/tools/start-ws.sh @@ -5,5 +5,7 @@ # start websocket service cd $(dirname $(dirname $0)) -source ./venv/bin/activate +if [ -f ./venv/bin/activate ]; then + source ./venv/bin/activate +fi exec daphne -p 9002 spug.asgi:application