Skip to content

Instantly share code, notes, and snippets.

@marraia
Last active July 27, 2018 13:10
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 marraia/dedd23a1e4de56e7603ba2044b4f4fca to your computer and use it in GitHub Desktop.
Save marraia/dedd23a1e4de56e7603ba2044b4f4fca to your computer and use it in GitHub Desktop.
private RetryPolicy RetryPolicyPolly()
{
return Policy.Handle<HttpRequestException>()
//Quantidade de vezes de re-tentativas
.Retry(3, (exception, retryCount) =>
{
var msg =
$" RETRYCOUNT: {retryCount} |" +
$" STATUSCODE: {result.Result.StatusCode} |" +
$" EXCEPTION: {exception} |";
_log.LogWarning(msg);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment