paperclip-azure 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a06477db7d1fdc6a82c1a329fd7b4f5c174a7828
4
- data.tar.gz: f1331559ab4a6fb6651d4c53dca3bcf283e376cf
3
+ metadata.gz: e6ce779207ed37f3fafc0fac09ad624fc67e5aa5
4
+ data.tar.gz: 8847ab129675e2456346f221f9c670db161998a6
5
5
  SHA512:
6
- metadata.gz: 7bccb000ff6224e32ecbb13ca1226bf523cba07ccfddf6133de92c9af4b8eeb91d45286bf1dc7d5710ca1e721081b95dff33f94ab60fcff62fe20ab0681a98f8
7
- data.tar.gz: 37a9ed2e661d3da639c6c46cc6142fd86284789d69481f9459afea0f78d3a7a9e8ce7819f4a0c5faf397611178807be02dca2842a8831b5ed2c03fafafa23de1
6
+ metadata.gz: cd6e124e7ce7b410c9a8976cb77420ab967863c32cd5511914e13050b39216d044ef98ddcb53bcb09c7e9386a0498a5ad4960c2b54c07521c9e96f0e77d0eae2
7
+ data.tar.gz: cf78db036595d70aa52bbd3bb81c3b0c3e8f361e63b787769f635697fcf3e8feb2d0a6511462dfbb5ae7e94c2b0d1ba2e72a00893a0b54f89e3b0be394b61dae
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.7
1
+ 0.2.8
@@ -129,22 +129,28 @@ module Paperclip
129
129
 
130
130
  require 'azure/core/http/retry_policy' # For Some Reason, All Other Loading Locations Fail
131
131
  service.filters << ::Azure::Core::Http::RetryPolicy.new do |response, retry_data|
132
- status_code = response.status_code == 0 ? 500 : response.status_code
133
- @retry_count ||= 0
132
+ status_code = case
133
+ when !response.nil?
134
+ response.status_code
135
+ when !retry_data[:error].nil?
136
+ retry_data[:error].status_code
137
+ else
138
+ 500
139
+ end
140
+ status_code = 500 if status_code == 0
141
+ retry_data[:count] ||= 0
134
142
 
135
- if (status_code >= 300 && status_code < 500 && status_code != 408) ||
143
+ unless (status_code >= 300 && status_code < 500 && status_code != 408) ||
136
144
  status_code == 501 ||
137
145
  status_code == 505 ||
138
- response[:error].description == 'Blob type of the blob reference doesn\'t match blob type of the blob.' ||
139
- @retry_count >= 5
140
- @retry_count = 0
141
- else
142
- @retry_count += 1
146
+ retry_data[:error].description == 'Blob type of the blob reference doesn\'t match blob type of the blob.' ||
147
+ retry_data[:count] >= 5
148
+ retry_data[:count] += 1
143
149
 
144
- sleep ((2**@retry_count) - 1) * 5
150
+ sleep ((2** retry_data[:count]) - 1) * 5
145
151
  end
146
152
 
147
- @retry_count > 0
153
+ retry_data[:count] > 0
148
154
  end
149
155
 
150
156
  instances[options] = service
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "paperclip-azure"
8
- s.version = "0.2.7"
8
+ s.version = "0.2.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jordan Yaker", "Supportify, Inc."]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip-azure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Yaker