Skip to content

Commit e00575c

Browse files
committed
fix celery beat
1 parent d1ea802 commit e00575c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

deploy_prod.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ 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 \
35+
# stop celery worker with beat
36+
celery -A pythonkr_backend multi stop worker1 -c2 -B \
3737
--pidfile=/home/pk/celery-%n.pid \
3838
--logfile=/home/pk/logs/celery-%n%I.log
3939

@@ -60,7 +60,7 @@ gunicorn --workers=2 \
6060
--pid ${PID_FILE} \
6161
pythonkr_backend.wsgi
6262

63-
# start celery worker
64-
celery -A pythonkr_backend multi start worker1 -c2 \
63+
# start celery worker with beat
64+
celery -A pythonkr_backend multi start worker1 -c2 -B \
6565
--pidfile=/home/pk/celery-%n.pid \
6666
--logfile=/home/pk/logs/celery-%n%I.log

pythonkr_backend/pythonkr_backend/settings/prod.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,7 @@
7979
CELERY_TASK_TRACK_STARTED = True
8080
CELERY_BROKER_URL = f"amqp://{CELERY_BROKER_USERNAME}:{CELERY_BROKER_PASSWORD}@localhost:5672/{CELERY_BROKER_VHOST}"
8181
CELERY_TASK_TIME_LIMIT = 30 * 60
82-
CELERY_RESULT_BACKEND = 'django-db'
82+
CELERY_RESULT_BACKEND = 'django-db'
83+
84+
# django-celery-beat
85+
CELERY_BEAT_SCHEDULER = 'django_celery_beat.schedulers:DatabaseScheduler'

0 commit comments

Comments
 (0)