Celery Result backend. DisabledBackend object has

2019-02-17 05:34发布

I have configured celery and the backend:

cleryapp = Celery(
    'tasks_app', brocker='amqp://guest@localhost//',
    backend='db+postgresql://guest@localhost:5432'
)

'results' appears disabled when i start the worker, but I read on another question here that that's not the issue.

The database is getting all the data correctly, but

result = AsyncResult(task_id)

raises

AttributeError: 'DisabledBackend' object has no attribute '_get_task_meta_for'

标签: python celery
3条回答
我想做一个坏孩纸
2楼-- · 2019-02-17 05:48

just like it said celery , you should specify the value of backend, just like: app = Celery("tasks", broker='mongodb://localhost:27017/test',backend='mongodb://localhost:27017/test1')

查看更多
做个烂人
3楼-- · 2019-02-17 05:54

I found a more convenient way to do that.

result = celery.AsyncResult(task_id)

celery is the Celery instance of your application, not the celery module.

查看更多
三岁会撩人
4楼-- · 2019-02-17 06:00

try using this instead where task is the name of your task function:

result = task.AsyncResult(task_id)
查看更多
登录 后发表回答