我的Celery配置中
BROKER_URL = 'redis://127.0.0.1:6379' CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6379'
但是,每当我运行celery时,都会出现此错误
consumer: Cannot connect to amqp://guest@127.0.0.1:5672//: [Errno 111] Connection refused. Trying again in 2.00 seconds...
为什么它不连接到我正在运行的Redis代理,而后者正在运行?
导入您的Celery并像这样添加您的经纪人:
celery = Celery('task', broker='redis://127.0.0.1:6379') celery.config_from_object(celeryconfig)
该代码属于celery.py