Skip to content

Instantly share code, notes, and snippets.

@HowardvanRooijen
Created March 3, 2015 08:01
Show Gist options
  • Save HowardvanRooijen/f26a5ccffdda9ebf6527 to your computer and use it in GitHub Desktop.
Save HowardvanRooijen/f26a5ccffdda9ebf6527 to your computer and use it in GitHub Desktop.
DoNotRetryOn304NotModified extension for Endjin.Retry
#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