routemaster-drain 3.5.1 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +6 -0
- data/lib/routemaster/api_client.rb +3 -1
- data/lib/routemaster/drain.rb +1 -1
- data/spec/routemaster/api_client_spec.rb +24 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 704afcba6a7b48237368e3a5f93896a152a2a081
|
4
|
+
data.tar.gz: bb825aa6d94898131fa8185d4c5264296c5c2aed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44916cd9440ba47737a567527755a085034c222e892e311ecc848a114634c25d44c81219ef1c58290e8b2d10ad18f23bdb57a939d9d84072cf3ef4a7665a9bf2
|
7
|
+
data.tar.gz: f19f4000b1250ddcccce85e6dcf4c0d3fde1c741f68f314da336525f228c619f15f98e682b8f3b059f2eed46c562033864582957ad149e3201e5cd21afb1b112
|
data/CHANGELOG.md
CHANGED
@@ -43,6 +43,7 @@ module Routemaster
|
|
43
43
|
@source_peer = options.fetch :source_peer, nil
|
44
44
|
@retry_attempts = options.fetch :retry_attempts, 2
|
45
45
|
@retry_methods = options.fetch :retry_methods, Faraday::Request::Retry::IDEMPOTENT_METHODS
|
46
|
+
@retry_exceptions = options.fetch :retry_exceptions, Faraday::Request::Retry::Options.new.exceptions
|
46
47
|
|
47
48
|
connection # warm up connection so Faraday does all it's magical file loading in the main thread
|
48
49
|
end
|
@@ -130,7 +131,8 @@ module Routemaster
|
|
130
131
|
max: @retry_attempts,
|
131
132
|
interval: 100e-3,
|
132
133
|
backoff_factor: 2,
|
133
|
-
methods: @retry_methods
|
134
|
+
methods: @retry_methods,
|
135
|
+
exceptions: @retry_exceptions
|
134
136
|
f.response :mashify
|
135
137
|
f.response :json, content_type: /\bjson/
|
136
138
|
f.use Routemaster::Middleware::ResponseCaching, listener: @listener
|
data/lib/routemaster/drain.rb
CHANGED
@@ -208,6 +208,30 @@ describe Routemaster::APIClient do
|
|
208
208
|
end
|
209
209
|
end
|
210
210
|
end
|
211
|
+
|
212
|
+
context 'when request raises fatal resource exception' do
|
213
|
+
let(:env) { double(body: body, url: url, method: 'PUT') }
|
214
|
+
|
215
|
+
subject do
|
216
|
+
begin
|
217
|
+
fetcher.put(url, body: body, headers: headers)
|
218
|
+
rescue Routemaster::Errors::FatalResource
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
before do
|
223
|
+
stub_request(:put, url).to_raise(Routemaster::Errors::FatalResource.new(env))
|
224
|
+
end
|
225
|
+
|
226
|
+
context 'when retry exceptions is specified' do
|
227
|
+
let(:fetcher) { described_class.new(retry_exceptions: [ Routemaster::Errors::FatalResource ]) }
|
228
|
+
|
229
|
+
it 'tries to PUT request three times' do
|
230
|
+
subject
|
231
|
+
assert_requested(:put, url, body: body, times: 3)
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
211
235
|
end
|
212
236
|
|
213
237
|
describe '#patch' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: routemaster-drain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Letessier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -287,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
287
287
|
version: '0'
|
288
288
|
requirements: []
|
289
289
|
rubyforge_project:
|
290
|
-
rubygems_version: 2.
|
290
|
+
rubygems_version: 2.6.11
|
291
291
|
signing_key:
|
292
292
|
specification_version: 4
|
293
293
|
summary: Event receiver for the Routemaster bus
|