when i run this command for celery beat.
[2013-06-27 02:17:05,936: INFO/MainProcess] Celerybeat: Starting...
[2013-06-27 02:17:05,937: INFO/MainProcess] Writing entries...
[2013-06-27 02:17:08,711: INFO/MainProcess] DatabaseScheduler: Schedule changed.
[2013-06-27 02:17:08,712: INFO/MainProcess] Writing entries...
it is stuck on this result. but in my settings.py I have configured the CELERYBEAT_SCHEDULE.
CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"
from datetime import timedelta
CELERYBEAT_SCHEDULE = {
'add-every-30-seconds': {
'task': 'celerytest.tasks.add',
'schedule': timedelta(seconds=30),
'args': (16, 16)
},
'add-every-10-seconds': {
'task': 'celerytest.tasks.minus',
'schedule': timedelta(seconds=10),
'args': (20, 16)
},
}
What's wrong with my celery beat?
Simplest way to check celery beat is running: ps aux | grep -i '[c]elerybeat' . If you get text string with pid it's running. Also you can make output of this command more pretty: ps aux | grep -i '[c]elerybeat' | awk '{print $2}' . If you get number - it's working, if you get nothing - it's not working.
The celery purge program, used to delete messages from queues. Erase all messages from all known task queues. There's no undo operation for this command.
celery beat is a scheduler; It kicks off tasks at regular intervals, that are then executed by available worker nodes in the cluster. By default the entries are taken from the beat_schedule setting, but custom stores can also be used, like storing the entries in a SQL database.
The celery beat
command starts the celery scheduler. This process schedules tasks and places them in a queue periodically. It does not execute tasks.
You need to start celery beat
and celery worker
(I guess you are using django-celery):
python manage.py celery beat
python manage.py celery worker
Or simply:
python manage.py celery worker --beat
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With