Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 442
jgoldberg Avatar asked May 21 '11 19:05

jgoldberg


People also ask

What is use of Celery in Django?

Celery makes it easier to implement the task queues for many workers in a Django application.

How do you use Celery beat in Django?

To use the Celery Beat, we need to configure the Redis server in the Django projects settings.py file. As we have installed the Redis server on the local machine, we will point the URL to localhost. The CELERY_TIMEZONE variable must be correctly set to run the tasks at the intended times.

What does Celery beat do?

Introduction. celery beat is a scheduler. It kicks off tasks at regular intervals, which are then executed by the worker nodes available in the cluster. By default the entries are taken from the CELERYBEAT_SCHEDULE setting, but custom stores can also be used, like storing the entries in an SQL database.

Can we use Celery without Django?

Yes you can. Celery is a generic asynchronous task queue. In place of "django_project" you would point to your module.


1 Answers

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.

like image 116
Mauro Rocco Avatar answered Sep 17 '22 14:09

Mauro Rocco