5

I am trying to get Celery work for awhile now. All my crontabs works just fine when I test it synchronously

sudo celery -A testdjango worker --loglevel=DEBUG --beat

but when I do

celery multi start -A testdjango w1 -l info

none of my crontabs work. I am not sure why

Note: I tried other schedule intervals as well like with time delta The same thing happens with that as well.

So I am fairly certain this is not a crontab thing but somehow related to the way I am starting celery multi.

Also, the worker turns on just fine since I can see it in Celery Flower but no tasks get executed.

4

2 回答 2

6

所以,答案很简单

由于周期性任务需要Beat只需在命令中添加 --beat。

像这样的东西

celery multi start -A testdjango w1 --beat -l info
于 2014-04-29T00:43:33.133 回答
4

或者,您可以在后台运行它,而不是在您的工作进程中运行 Beat(不推荐 3.1.18 的文档说)

celery beat -A testdjango --pidfile=/blah/beat.pid --detach

确保将 pidfile 保存在某处,以便以后也可以终止该进程。

于 2015-07-27T02:55:40.653 回答