Celery doesn't select CELERY_ALWAYS_EAGER settings

I am running Django 1.8 + Celery 4.0.2 Celery is well configured and can run my django tasks locally on the redis backend. But when I try to use CELERY_ALWAYS_EAGER = True, these settings have no effect. Which does not apply to other settings, for example. CELERY_TIMEZONE

Specifically in the pdb I see that app.conf.task_always_eager is False lib / python2.7 / site-packages / celery / app / task.py (520) apply_async () So somehow CELERY_ALWAYS_EAGER is not fetching and not affected at app.conf.task_always_eager

More info: pdb:

> app.conf.get('CELERY_ALWAYS_EAGER')
> True
> app.conf.task_always_eager
> False

      

What could be causing this? I know that Celery 4.x is going from old preference names to new ones, but they still promise that the old preference names will still be used.

+3


source to share


2 answers


CELERY_ALWAYS_EAGER

was renamed to CELERY_TASK_ALWAYS_EAGER

in version 4.0+.

More specifically, the all-caps settings have been deprecated in favor of directly configuring the celery application object, and several of them have been put in names to use task_

or worker_

prefix. Since there is still backward compatibility with all-caps settings, this indirectly renamed all-caps as well.



From the changelog :

The celery_ prefix has also been removed, and job related parameters from this namespace are now prefixed with job_, worker related parameters with worker_.

+6


source


Please restart the celery worker after setting CELERY_ALWAYS_EAGER = True in settings.py and see if it helps.



0


source







All Articles