knapsack_pro 0.18.0 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/knapsack_pro/client/connection.rb +3 -1
- data/lib/knapsack_pro/version.rb +1 -1
- data/spec/knapsack_pro/client/connection_spec.rb +2 -2
- 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: c11586bb78f84d7cf17f4777450e10e93d0b0b08
|
4
|
+
data.tar.gz: 47d8e142789e12bae228be825f3f9788a03487d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0659bed3a7b0be304089b764e528938bc664d9698c39585eac1cc6b1f7df4f79a46e15722f1196b54d753d4d2a7c9182c9f0fec3eb2e3fb5cae76a85d1b3885f'
|
7
|
+
data.tar.gz: 0366b18ab1098eed6fcfeab6a72b0c04fd9382d5aeef6ff02f6051c73449df9c2cd1cfef4939b75b3503ce0d395655145c0a8fa5b733acdbdc9322c746c71e5d
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module KnapsackPro
|
2
2
|
module Client
|
3
3
|
class Connection
|
4
|
-
TIMEOUT =
|
4
|
+
TIMEOUT = 30
|
5
5
|
|
6
6
|
def initialize(action)
|
7
7
|
@action = action
|
@@ -75,6 +75,7 @@ module KnapsackPro
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def post
|
78
|
+
retries ||= 0
|
78
79
|
uri = URI.parse(endpoint_url)
|
79
80
|
http = Net::HTTP.new(uri.host, uri.port)
|
80
81
|
http.use_ssl = (uri.scheme == 'https')
|
@@ -98,6 +99,7 @@ module KnapsackPro
|
|
98
99
|
response
|
99
100
|
rescue Errno::ECONNREFUSED, EOFError, SocketError, Net::OpenTimeout, Net::ReadTimeout => e
|
100
101
|
logger.warn(e.inspect)
|
102
|
+
retry if (retries += 1) < 3
|
101
103
|
end
|
102
104
|
end
|
103
105
|
end
|
data/lib/knapsack_pro/version.rb
CHANGED
@@ -30,8 +30,8 @@ describe KnapsackPro::Client::Connection do
|
|
30
30
|
expect(Net::HTTP).to receive(:new).with('api.knapsackpro.dev', 3000).and_return(http)
|
31
31
|
|
32
32
|
expect(http).to receive(:use_ssl=).with(false)
|
33
|
-
expect(http).to receive(:open_timeout=).with(
|
34
|
-
expect(http).to receive(:read_timeout=).with(
|
33
|
+
expect(http).to receive(:open_timeout=).with(30)
|
34
|
+
expect(http).to receive(:read_timeout=).with(30)
|
35
35
|
|
36
36
|
header = { 'X-Request-Id' => 'fake-uuid' }
|
37
37
|
http_response = instance_double(Net::HTTPOK, body: body, header: header)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knapsack_pro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArturT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|