Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Celerybeat not executing periodic tasks

How do you diagnose why manage.py celerybeat won't execute any tasks?

I'm running celerybeat via supervisord with the command:

/usr/local/myapp/src/manage.py celerybeat --schedule=/tmp/celerybeat-schedule-myapp --pidfile=/tmp/celerybeat-myapp.pid --loglevel=INFO

Supervisord appears to run celerybeat just fine, and the log file shows:

[2013-06-12 13:17:12,540: INFO/MainProcess] Celerybeat: Starting...
[2013-06-12 13:17:12,571: WARNING/MainProcess] Reset: Account for new __version__ field
[2013-06-12 13:17:12,571: WARNING/MainProcess] Reset: Account for new tz field
[2013-06-12 13:17:12,572: WARNING/MainProcess] Reset: Account for new utc_enabled field

I have several periodic tasks showing as enabled on http://localhost:8000/admin/djcelery/periodictask which should run every few minutes. However, the celerybeat log never shows anything being executed. Why would this be?

like image 552
Cerin Avatar asked Jun 12 '13 17:06

Cerin


1 Answers

celerybeat will just schecdule task, wont execute it. To execute task you need to also start worker. You can start celery beat as well as worker together. I use "celeryd -B"

In your case it should look like:

/usr/local/myapp/src/manage.py celery worker --beat --schedule=/tmp/celerybeat-schedule-myapp --pidfile=/tmp/celerybeat-myapp.pid --loglevel=INFO

or

/usr/local/myapp/src/manage.py celeryd -B --schedule=/tmp/celerybeat-schedule-myapp --pidfile=/tmp/celerybeat-myapp.pid --loglevel=INFO

like image 130
YoK Avatar answered Nov 03 '22 19:11

YoK