'How to fire a method after retries finished in polly dot net
How can I fire a method after retries finished. My code :
var polly = Policy.Handle<HttpRequestException>()
.OrResult<CustomHttpResponse>(a => a.StatusCode != HttpStatusCode.OK)
.WaitAndRetryAsync(10, sleep => TimeSpan.FromSeconds(2), (e, t) =>
{
Console.Out.WriteLine("{0} failed. retry for other requests. elapsed time : {1}", e, t);
});
...
await polly.ExecuteAsync(async ct =>
response = await _internalHttpClient.GetAsJsonAsync<IList<UserDto>>(url, cancellationToken),
cancellationToken);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
