esi 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/esi.rb +1 -1
- data/lib/esi/client.rb +6 -4
- data/lib/esi/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: 9f9b84385a666713670f07bd37de57fa7a956c71
|
4
|
+
data.tar.gz: e7363c2c81e5274d52a871a6292e8d8cb606cd88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 197aeb8691000e09ea03aec8dc84bc773b1291772fde691a07e870f70e513352eeaccd18c6559e0dab9a890f26c259df48a687f3c863cb1feb29f51260ff4579
|
7
|
+
data.tar.gz: 75e2b2ba3a22d59f1176d42c3f51a405831784969edf89e153dec08ca6498e30accac4023aa88ab309d5453b9563e2750ecca3af08e534eb3dd2ffcc927cbc59
|
data/lib/esi.rb
CHANGED
data/lib/esi/client.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Esi
|
2
2
|
class Client
|
3
|
-
MAX_ATTEMPTS =
|
3
|
+
MAX_ATTEMPTS = 3
|
4
4
|
|
5
5
|
attr_accessor :refresh_callback, :access_token, :refresh_token, :expires_at
|
6
6
|
attr_reader :logger, :oauth
|
@@ -82,8 +82,10 @@ module Esi
|
|
82
82
|
last_ex = nil
|
83
83
|
|
84
84
|
begin
|
85
|
-
response =
|
86
|
-
|
85
|
+
response = Timeout::timeout(Esi.config.timeout) do
|
86
|
+
oauth.request(call.method, url, options)
|
87
|
+
end
|
88
|
+
rescue Timeout::Error, Net::ReadTimeout => e
|
87
89
|
last_ex = e
|
88
90
|
logger.error "ReadTimeout received"
|
89
91
|
sleep 2
|
@@ -111,7 +113,7 @@ module Esi
|
|
111
113
|
logger.error "ApiUnknownError (#{response.status}): #{url}"
|
112
114
|
|
113
115
|
case response.error
|
114
|
-
when 'invalid_client'
|
116
|
+
when 'invalid_client'
|
115
117
|
raise ApiInvalidAppClientKeysError.new(response)
|
116
118
|
else
|
117
119
|
raise Esi::ApiUnknownError.new(response)
|
data/lib/esi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Hiemstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth2
|