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
I have a polly policy declared for my httpclient, I could do with a sample on how to get both polly and RateLimiter to play nice with eachother.
services.AddHttpClient<MyHttpClient>().SetHandlerLifetime(TimeSpan.FromMinutes(5)).AddPolicyHandler((serviceProvider,_)=>HttpPolicyExtensions.HandleTransientHttpError().WaitAndRetryAsync(Backoff.DecorrelatedJitterBackoffV2(TimeSpan.FromSeconds(1),5),(outcome,delay,i,_)=>{varlogger=serviceProvider.GetService<ILogger<MyHttpClient>>();if(logger!=null){if(outcome.Exception!=null){logger.LogError(outcome.Exception,"Delaying {Delay}, then making retry {Retry}. Result: {Result}",delay,i,outcome.Result);}else{logger.LogWarning("Delaying {Delay}, then making retry {Retry}. Result: {Result}",delay,i,outcome.Result);}}}));
The text was updated successfully, but these errors were encountered:
Hiya,
I have a polly policy declared for my httpclient, I could do with a sample on how to get both polly and RateLimiter to play nice with eachother.
The text was updated successfully, but these errors were encountered: