You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But it has no been possible to include the delay because of the number of attempts. I mean, i need to use the delay generated in the method WaitAndRetryForeverAsync. is it possible?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
Resurrecting this issue. An additional problem with using int.MaxValue as the retryCount is that Backoff.DecorrelatedJitterBackoffV2 will eventually return negative TimeSpan values. This can be easily seen by cloning the repo and changing the retryCount argument in Backoff_should_not_overflow_to_give_negative_timespan from 100 to 10000.
Re: point from @swimmesberger, I am not sure this is a problem in practice because even if each delay is an average of only 1 second, with a retryCount of int.MaxValue that still comes to 68 years.
I am trying to implement the policy with DecorrelatedJitterBackoffV2 method:
private static void SetPolicies()
{
var delay = Backoff.DecorrelatedJitterBackoffV2(medianFirstRetryDelay: TimeSpan.FromSeconds(1), retryCount: 5);
_policy = Policy.Handle().WaitAndRetryForeverAsync(retryAttempt => TimeSpan.FromMilliseconds(Math.Pow(2, retryAttempt)),
(exception, timespan, context) =>
{
Log.Information( exception.Message);
});
}
But it has no been possible to include the delay because of the number of attempts. I mean, i need to use the delay generated in the method WaitAndRetryForeverAsync. is it possible?
Thanks in advance.
The text was updated successfully, but these errors were encountered: