lib/paperclip/storage/azure.rb in paperclip-azure-0.2.6 vs lib/paperclip/storage/azure.rb in paperclip-azure-0.2.7
- old
+ new
@@ -52,11 +52,10 @@
module Azure
def self.extended base
begin
require 'azure'
- require 'azure/core/http/retry_policy'
rescue LoadError => e
e.message << " (You may need to install the azure SDK gem)"
raise e
end unless defined?(::Azure::Core)
@@ -126,9 +125,10 @@
unless instances[options]
signer = ::Azure::Core::Auth::SharedKey.new options[:storage_account_name], options[:access_key]
service = ::Azure::BlobService.new(signer, options[:storage_account_name])
+ require 'azure/core/http/retry_policy' # For Some Reason, All Other Loading Locations Fail
service.filters << ::Azure::Core::Http::RetryPolicy.new do |response, retry_data|
status_code = response.status_code == 0 ? 500 : response.status_code
@retry_count ||= 0
if (status_code >= 300 && status_code < 500 && status_code != 408) ||