Created
April 30, 2019 10:36
-
-
Save mvodep/b3d8946bbd369b4a2c1dc2c5619fcb8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Retry, waiting a specified duration between each retry, | |
// calling an action on each retry with the current exception, | |
// duration and context provided to Execute() | |
Policy | |
.Handle<SomeExceptionType>() | |
.WaitAndRetry(new[] | |
{ | |
TimeSpan.FromSeconds(1), | |
TimeSpan.FromSeconds(2), | |
TimeSpan.FromSeconds(3) | |
}, (exception, timeSpan, context) => { | |
// do something | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment