What are the django-celery (djcelery) tables for?

萝らか妹 提交于 2019-12-05 12:24:48

问题


When I run syncdb, I notice a lot of tables created like:

  • djcelery_crontabschedule
  • ...
  • djcelery_taskstate

django-kombu is providing the transport, so it can't be related to the actual queue. Even when I run tasks, I still see nothing populated in these tables. What are these tables used for? Monitoring purposes only -- if I enable it?

If so, is it also true that if I do a lookup of AsyncResult(), I'm guessing that is actually looking up the task result via the django-kombu tables instead of djcelery?

Thanks.


回答1:


The celery task_state table, populated by the daemon celerycam, is just for monitoring purposes.

The other tables, like "crontabschedule" "intervals" etc. are for scheduling periodic tasks by using the django backend db. These tables are used when you launch celery in beat mode (-B) and when you have this var set in the settings

CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"

In this way you tell celery to use the django db for schedule tasks.



来源:https://stackoverflow.com/questions/6084009/what-are-the-django-celery-djcelery-tables-for

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!