开发者

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

开发者 https://www.devze.com 2023-02-21 20:30 出处:网络
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

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 开发者_C百科from the database, how do I go about retrieving information about the task's state/result/etc?


From the Celery FAQ:

result = MyTask.AsyncResult(task_id)
result.get()
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号