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 CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- waz-storage (1.2.0)
4
+ waz-storage (1.3.0)
5
5
  rest-client
6
6
  ruby-hmac
7
7
 
@@ -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
- request.execute()
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
@@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
11
11
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
12
12
  gem.name = "waz-storage"
13
13
  gem.require_paths = ["lib"]
14
- gem.version = "1.3.2"
14
+ gem.version = "1.3.3"
15
15
 
16
16
  gem.test_files = Dir['tests/**/*']
17
17
 
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.2
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-02-19 00:00:00.000000000 Z
12
+ date: 2013-03-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client