Created
March 3, 2015 08:01
-
-
Save HowardvanRooijen/f26a5ccffdda9ebf6527 to your computer and use it in GitHub Desktop.
DoNotRetryOn304NotModified extension for Endjin.Retry
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
#region Using Directives | |
using System; | |
using System.Net; | |
using Endjin.Core.Retry.Policies; | |
using Microsoft.WindowsAzure.Storage; | |
#endregion | |
public class DoNotRetryOn304NotModified : IRetryPolicy | |
{ | |
public bool CanRetry(Exception exception) | |
{ | |
var storageException = exception as StorageException; | |
if (storageException == null) | |
{ | |
return true; | |
} | |
return storageException.RequestInformation.HttpStatusCode != (int)HttpStatusCode.NotModified; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment