Polly.Contrib.WaitAndRetry icon indicating copy to clipboard operation
Polly.Contrib.WaitAndRetry copied to clipboard

Custom routine for last attempt (giving up)

Open pinx opened this issue 2 years ago • 0 comments

We want to log retries and 'giving up' with its own message. I now implemented this with a condition in the Retry: if (attempt < MaxAttempts) {normal behavior} else {custom log message} with MaxAttempts one higher than the actual number of attempts.

I'm not sure what the most elegant solution would be. Maybe a fluent method like GiveUpWith() after Retry?

pinx avatar Feb 28 '23 13:02 pinx