3

我已经CELERY_ALWAYS_EAGER = True在测试环境中设置了 django 的设置。

但不知何故,我仍然收到了这条消息。

ERROR:cacheback:Unable to trigger task asynchronously - failing over to synchronous refresh
ERROR:cacheback:[Errno 111] Connection refused

实际上是CELERY_ALWAYS_EAGER = True有效的,这是我从 django shell 得到的。

$ python manage.py shell
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.conf import settings
>>> from celery import Celery
>>> app = Celery()
>>> app.config_from_object('django.conf:settings')
>>> print app.conf.CELERY_ALWAYS_EAGER
True
>>> @app.task()
... def foo():
...   print('FOO')
... 
>>> print foo.delay()
FOO
4ff95b5c-f8bc-412b-ad19-602082aec1e9
>>> 

它知道为什么我仍然收到错误消息吗?非常感谢 !

4

0 回答 0