waz-storage 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/waz/storage/core_service.rb +14 -2
- data/waz-storage.gemspec +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
@@ -4,6 +4,7 @@ module WAZ
|
|
4
4
|
# this module is imported from WAZ::Queues::Service and WAZ::Blobs::Service.
|
5
5
|
module SharedKeyCoreService
|
6
6
|
attr_accessor :account_name, :access_key, :use_ssl, :base_url, :type_of_service, :use_devenv, :use_sas_auth_only, :sharedaccesssignature
|
7
|
+
attr_accessor :retry_count
|
7
8
|
|
8
9
|
# Creates an instance of the implementor service (internally used by the API).
|
9
10
|
def initialize(options = {})
|
@@ -17,7 +18,8 @@ module WAZ
|
|
17
18
|
self.use_ssl = options[:use_ssl] or false
|
18
19
|
self.use_devenv = !!options[:use_devenv]
|
19
20
|
self.base_url = "#{options[:type_of_service] or "blobs"}.#{options[:base_url] or "core.windows.net"}" unless self.use_devenv
|
20
|
-
self.base_url ||= (options[:base_url] or "core.windows.net")
|
21
|
+
self.base_url ||= (options[:base_url] or "core.windows.net")
|
22
|
+
self.retry_count = (options[:retry_count] or 5)
|
21
23
|
end
|
22
24
|
|
23
25
|
# Generates a request based on Adam Wiggings' rest-client, including all the required headers
|
@@ -116,7 +118,17 @@ module WAZ
|
|
116
118
|
escaped_path = path.split("/").map{ | part | CGI.escape(part) }.join("/")
|
117
119
|
url = generate_request_uri(escaped_path, query)
|
118
120
|
request = generate_request(verb, url, headers, payload)
|
119
|
-
|
121
|
+
|
122
|
+
errors = 0
|
123
|
+
begin
|
124
|
+
request.execute()
|
125
|
+
rescue Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::ECONNRESET => e
|
126
|
+
errors += 1
|
127
|
+
if errors > self.retry_count
|
128
|
+
raise e.class, e.message, e.backtrace
|
129
|
+
end
|
130
|
+
retry
|
131
|
+
end
|
120
132
|
end
|
121
133
|
end
|
122
134
|
end
|
data/waz-storage.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: waz-storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-03-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|