问题描述:
celery flask中用task_id获取结果时遇到如下问题,正常不用flask没有问题
AttributeError: 'DisabledBackend' object has no attribute '_get_task_meta_for'
1.排查 backend
from celery import Celery
broker = 'redis://127.0.0.1:6379/1'
backend = 'redis://127.0.0.1:6379/2'
app_celery = Celery('tasks', broker=broker, backend=backend)
- 检查获取结果时是否设置app
res = AsyncResult(task_id,app=app_celery)
-
重启所有python进程
-
重启 celery