If skip_retry is a function and that function returns true No more retries are happening. This is particularly useful when you know there are errors where another retry is not only not necessary, but can be actively harmful.
I acknowledge that there is a work around with using on_exception using the following construct.
try:
some code
except ErrorThrown as e:
if e.condition:
raise ErrorThatWillBeIgnoredByRetry
However, that would require a fair bit of rewriting, it would be neater if you could set conditions in the skip_retry function and if those conditions are fulfilled no retries would be done.
If skip_retry is a function and that function returns true No more retries are happening. This is particularly useful when you know there are errors where another retry is not only not necessary, but can be actively harmful.
I acknowledge that there is a work around with using
on_exception
using the following construct.However, that would require a fair bit of rewriting, it would be neater if you could set conditions in the
skip_retry
function and if those conditions are fulfilled no retries would be done.