Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Celery: How to retrieve metadata from custom states?

Tags:

celery

The example for custom states show that metadata can be stored: http://docs.celeryproject.org/en/latest/userguide/tasks.html#custom-states

Which API can I use to retrieve the metadata associated with a result?

like image 286
lairtech Avatar asked Dec 12 '13 16:12

lairtech


1 Answers

The docs don't make it clear how to get the metadata from the result. Use AsyncResult.info.

>>> job = AsyncResult(job_id)
>>> print(job.info)
{'current': 2, 'total': 100}
like image 76
Nathan Kovner Avatar answered Oct 03 '22 09:10

Nathan Kovner