3👍
A bit of a hack, but what works for me is creating a new task instance with the same task ID. For example, a task with ID ‘abc’ runs and fails. I then “restart” the task by running:
my_task.apply_async(args=('whatever'), task_id='abc')
In reality it is less of a “restart” and more just a replacement of the original task result, but it gets the job done. Definitely open to better suggestions here as it does feel a bit clumsy.
Source:stackexchange.com