Skip to content

Instantly share code, notes, and snippets.

@angelobelchior
Last active September 2, 2019 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelobelchior/91f69cc1af08f5a66961b3424f192e2b to your computer and use it in GitHub Desktop.
Save angelobelchior/91f69cc1af08f5a66961b3424f192e2b to your computer and use it in GitHub Desktop.
private AsyncRetryPolicy CreatePolicy(RetryPolicyConfiguration retryPolicyConfiguration)
=> Policy.Handle<Exception>(e => true)
.WaitAndRetryAsync(retryCount: retryPolicyConfiguration.RetryCount,
retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryPolicyConfiguration.RetryAttemptFactor))
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment