lib/paperclip/storage/azure.rb in paperclip-azure-0.2.8 vs lib/paperclip/storage/azure.rb in paperclip-azure-0.2.9

- old
+ new

@@ -138,14 +138,16 @@ 500 end status_code = 500 if status_code == 0 retry_data[:count] ||= 0 - unless (status_code >= 300 && status_code < 500 && status_code != 408) || + if (status_code >= 300 && status_code < 500 && status_code != 408) || status_code == 501 || status_code == 505 || retry_data[:error].description == 'Blob type of the blob reference doesn\'t match blob type of the blob.' || retry_data[:count] >= 5 + retry_data[:count] = 0 + else retry_data[:count] += 1 sleep ((2** retry_data[:count]) - 1) * 5 end