Search code examples
pythondjangorediscelerydjcelery

Changing CELERYBEAT_SCHEDULER


I'm have two django apps using the same database. Both using celery and having own CELERYBEAT_SCHEDULE. Is there a way to distinct which tasks should be run in proper celery worker ? now tasks from both apps are scheduled in the same worker. The reason of that is (?) CELERYBEAT_SCHEDULER to 'djcelery.schedulers.DatabaseScheduler'. I couldn't find any approach/scheduler not using Database. As a broker I'm using redis (local/different for each app) so tasks from outside of CELERYBEAT_SCHEDULE are working properly.


Solution

  • You can define two queues in CELERY_QUEUES setting and assign one queue to each celerybeat using --queues=queue1 parameter.

    You can assing task to specific queue using options:

    'options': {'queue': 'queue1'},