Skip to content

Commit d1ea802

Browse files
committed
add worker on startup script
1 parent b26a170 commit d1ea802

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

deploy_prod.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ export DJANGO_SETTINGS_MODULE="pythonkr_backend.settings.prod"
3232
./manage.py loaddata fixtures.json
3333
./manage.py collectstatic --clear --noinput
3434

35+
# stop celery worker
36+
celery -A pythonkr_backend multi stop worker1 -c2 \
37+
--pidfile=/home/pk/celery-%n.pid \
38+
--logfile=/home/pk/logs/celery-%n%I.log
39+
3540
# shutdown exist gunicorn
3641
if [ -f ${PID_FILE} ]; then
3742
PID=$(cat $PID_FILE)
@@ -54,3 +59,8 @@ gunicorn --workers=2 \
5459
--daemon \
5560
--pid ${PID_FILE} \
5661
pythonkr_backend.wsgi
62+
63+
# start celery worker
64+
celery -A pythonkr_backend multi start worker1 -c2 \
65+
--pidfile=/home/pk/celery-%n.pid \
66+
--logfile=/home/pk/logs/celery-%n%I.log

0 commit comments

Comments
 (0)