brightpearl_api 1.1.7 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/brightpearl_api.rb +1 -0
- data/lib/brightpearl_api/client.rb +7 -0
- data/lib/brightpearl_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90631aeb062267b987fdc8842250d00d829bec64
|
4
|
+
data.tar.gz: bfae106f4a7c2aa4284189f3065532dad06faf52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e46e0420354388667e0014015285c729f82c87ac5f8a2ba1ae26bf5f24ed05590ede62a5cacb702bf32670a36cb0e1b9458ccd67ee74a38ed73a58ccb93d3914
|
7
|
+
data.tar.gz: 7f417474574d02a9afe4213953cd80e37689dcd17dd842872877af45e2b7c4c1c5958a609258a8e82d3520f1e02254392d7ba2c20366a8d2a5044319ae7e938f
|
data/lib/brightpearl_api.rb
CHANGED
@@ -17,6 +17,10 @@ module BrightpearlApi
|
|
17
17
|
rescue AuthException => e
|
18
18
|
reset_token
|
19
19
|
api_call(type, path, data)
|
20
|
+
rescue ThrottleException => e
|
21
|
+
sleep(5.seconds)
|
22
|
+
reset_token
|
23
|
+
api_call(type, path, data)
|
20
24
|
end
|
21
25
|
|
22
26
|
def api_call(type, path, data = {})
|
@@ -86,6 +90,9 @@ module BrightpearlApi
|
|
86
90
|
if (response['response'].is_a? String) && (response['response'].include? 'Not authenticated')
|
87
91
|
raise AuthException, "#{response.to_json}"
|
88
92
|
end
|
93
|
+
if (response['response'].is_a? String) && (response['response'].include? 'Please wait before sending another request')
|
94
|
+
raise ThrottleException, "#{response.to_json}"
|
95
|
+
end
|
89
96
|
end
|
90
97
|
end
|
91
98
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brightpearl_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kunwar Aditya Raghuwanshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|