Retrieve a task result object, given a `task_id` in Celery

Question:

I store the task_id from an celery.result.AsyncResult in a database and relate it to the item that the task affects. This allows me to perform a query to retrieve all the task_ids of tasks that relate to a specific item.

So after retrieving the task_id from the database, how do I go about retrieving information about the task’s state/result/etc?

Asked By: bradley.ayers

||

Answers:

From the Celery FAQ:

result = MyTask.AsyncResult(task_id)
result.get()
Answered By: miles82
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.