pipeline_dealers 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,7 +24,15 @@ module PipelineDealers
24
24
  {get: :get_style, post: :post_style, put: :post_style, delete: :get_style}.each do |name, style|
25
25
  class_eval <<-RUBY
26
26
  def #{name} url, params = {}
27
- request_#{style}(:#{name}, url, params)
27
+ while true # Try until we've got another response status than too many requests
28
+ status, response = request_#{style}(:#{name}, url, params)
29
+ if status == 429 # Too many requests? Sleep and try again
30
+ sleep 1
31
+ next
32
+ else
33
+ return [status, response]
34
+ end
35
+ end
28
36
  end
29
37
  RUBY
30
38
  end
@@ -1,3 +1,3 @@
1
1
  module PipelineDealers
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipeline_dealers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.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-03-06 00:00:00.000000000 Z
12
+ date: 2013-03-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday