Created
September 30, 2020 09:50
-
-
Save AndrewAllison/e05c55af7e75c85a3fd20477a89e0656 to your computer and use it in GitHub Desktop.
Using Polly lib with C# For retries.
This file contains hidden or 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
var processingPolicy = Policy | |
.Handle<SageLockingException>() | |
.Or<SageProductException>() | |
.WaitAndRetry(delay, onRetry: (exception, timeSpan, context) => | |
{ | |
HandleException(result, orderToProcess, exception); | |
}); | |
var orderResults = processingPolicy.Execute(() => sageOrderHandler.ProcessNewOrder(sageOrder)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment