简体   繁体   English

Django在Celery中的定期任务

[英]Django periodic tasks in Celery

i"m having this issue with periodic tasks not running. I"m using redis as a backend and can run the tasks manually, this is the celery debug log 我遇到周期性任务无法运行的问题。我使用Redis作为后端,可以手动运行任务,这是celery调试日志

[ModelEntry: myproject.myapp.tasks.MyPeriodicTask myproject.myapp.tasks.MyPeriodicTask(*[], **{}) { freq: 10.00 seconds }]
    [2012-08-01 13:45:53,764: DEBUG/MainProcess] Consumer: Ready to accept tasks!
    [2012-08-01 13:45:53,801: DEBUG/Beat] Celerybeat: Ticking with max interval->5.00 seconds
    [2012-08-01 13:45:53,808: DEBUG/Beat] Celerybeat: Waking up in 5.00 seconds.
    [2012-08-01 13:45:58,814: DEBUG/Beat] Celerybeat: Waking up in 5.00 seconds.
    [2012-08-01 13:46:03,828: DEBUG/Beat] Celerybeat: Waking up in 5.00 seconds.

When i run the task manually, everything works. 当我手动运行任务时,一切正常。 Timezone is the same in django and celery Django和celery的时区相同

As reported in Celery issue #4184 , you can solve this problem by changing CELERY_TIMEZONE to UTC. Celery问题#4184中所报告,您可以通过将CELERY_TIMEZONE更改为UTC来解决此问题。 I experienced a similar problem, but with the database scheduler, and this resolved it for me. 我遇到了类似的问题,但是使用数据库调度程序,这为我解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM