question

shambhumishra-4231 avatar image
0 Votes"
shambhumishra-4231 asked

PollyRetry configuration not working

Hi Team,

I am trying to integrate Polly Retry policy in our project for one off the database call.

Like for below method

Public Void GetDetailsFromDB()
{
//Do stuff
}

For this I want to retry 3 times if it fails, so we wrapped up below code with like

var policy=Policy
.Handle<Exception>
.OrResult<HttpREsponseMessage>(r=> httpStatusCode=500)
.Retry(3, ex,retcount)=>
{

});


dotnet-aspnet-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers