Skip to content

How can i use the DecorrelatedJitterBackoffV2 method for infinite retries? #29

@itachiCrash

Description

@itachiCrash

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions