Retry chain: how to get if signature of previously run task was immutable? #8658
-
I need to be able to retry Celery chains. That is: all tasks in a given chain with a non-success state should be run again. As far as I can see, that is not natively supported. So, I came up with the following:
Using
But one piece of the puzzle is missing: how do I know if the signature was mutable ( Untested POC:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Even with Therefore, I have decided to store this piece of information in a local database, and reconstruct the signature as follows:
where |
Beta Was this translation helpful? Give feedback.
Even with
result_extended
, whether a signature was mutable or immutable is not stored. This makes sense, because Celery stores results, not signatures (or even tasks in a more abstract sense).Therefore, I have decided to store this piece of information in a local database, and reconstruct the signature as follows:
where
result
is an instance ofcelery.AsyncResult
, andtask
is a local database object