DevÁsith
DevÁsith

Reputation: 1234

How to set MaxRetry value in msgraph-sdk-dotnet-auth authentication Providers

Is there way to set MaxRetry value when we use msgraph-sdk-dotnet-auth as authentication Providers. I could see it has set to 1 in AuthenticationProviderOption class

public class AuthenticationProviderOption : IAuthenticationProviderOption
{
        internal int MaxRetry { get; set; } = 1;
}

https://github.com/microsoftgraph/msgraph-sdk-dotnet-auth/blob/dev/src/Microsoft.Graph.Auth/ConfidentialClient/ClientCredentialProvider.cs#L97

Upvotes: 0

Views: 599

Answers (1)

Raghavendra beldona
Raghavendra beldona

Reputation: 2102

You can set the MaxRetry Property maximum value of 10 (retries). By default it will be 3 if you wont set anything.

Please refer the document

requestMessage.GetRequestContext().MiddlewareOptions.Add(
typeof(RetryHandlerOption).ToString(),
new RetryHandlerOption()
{
MaxRetry = 3
});

Please do refer the GitHub regarding how to set the MaxRetry property.

Upvotes: 1

Related Questions