Skip to content

Instantly share code, notes, and snippets.

@ksysiekj
Created February 25, 2017 22:58
Show Gist options
  • Save ksysiekj/1ea0af5bc0bc013f17c71c68c4381cfb to your computer and use it in GitHub Desktop.
Save ksysiekj/1ea0af5bc0bc013f17c71c68c4381cfb to your computer and use it in GitHub Desktop.
RetryHandler.RetryFor<WebException>(() =>
{
string content = DownloadContent();
Console.Write(content);
}, TimeSpan.FromSeconds(75), TimeSpan.FromSeconds(2), httpRequestException => httpRequestException.Status == WebExceptionStatus.Timeout
|| httpRequestException.Status == WebExceptionStatus.ConnectFailure, Logger);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment