I am planning to use celery as the task management component of my project. It has almost all the features that I need for my project. I will have a set of tasks which can execute independently or in the specified sequence. In the sequential tasks, I want the ability to perform cleanup/rollbacks if one of the intermediate tasks fails. I was wondering if there is a feature available in celery out of the box to do the same or is any workaround available.
Asked
Active
Viewed 682 times
1 Answers
0
Celery doesn't support anything similar to rollback. Your tasks should be small atomic steps and intermediate steps should not corrupt your database.
If you need to revert changes, you can create task which is doing opposite operation and call it when celery is retrying to perform one of the tasks.

daniula
- 6,898
- 4
- 32
- 49