Getting parameters of a failed django-celery task

扶醉桌前 提交于 2020-01-14 14:35:06

问题


Is it possible to get the arguments used to call a particular failed celery task given the task's ID? I am using MongoDB as the broker and using the django-celery package.

I know that you can get the result pretty easily but wanted to know if you can do the same with the arguments used to call that task.

Thanks


回答1:


I managed to solve this problem by implementing a custom on_failure handler for my task as specified here:

http://docs.celeryproject.org/en/latest/userguide/tasks.html#handlers

I got the args info along with the error and saved it to a database.



来源:https://stackoverflow.com/questions/14589872/getting-parameters-of-a-failed-django-celery-task

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!