Danny Vilela
12/22/2021, 9:34 PM@task
-decorated function with max_retries=8, retry_delay=dt.timedelta(minutes=15)
. However, I know that for certain kinds of errors, I’d actually want it to wait 30 minutes (or even an hour). Is there a way to implement this? I know I can probably just check for that exception then time.sleep
for the extra time (for example, to wait for an hour I’d catch the exception, time.sleep
for 45 minutes, then raise the error so that retry_delay
kicks in), but I’m wondering if there’s a cleaner way to approach this.
The above feels like a code smell but I’m not sure how I’d otherwise set context-specific retry delays on a task 🤔Anna Geller
Kevin Kho
type(new_state.result)
I think. And then you can put another time.sleep
in the state handler depending on the error type.