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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 6dd1c94d3030edaf763c7fcf700d2894e604ff7d44ee09f6df2fdc5770ce0e00
4
- data.tar.gz: 56dd0fe8f7f30d1e66eab9e94e826bbfed5c9496e2b19da056aa5a52bf73513b
2
+ SHA1:
3
+ metadata.gz: 704afcba6a7b48237368e3a5f93896a152a2a081
4
+ data.tar.gz: bb825aa6d94898131fa8185d4c5264296c5c2aed
5
5
  SHA512:
6
- metadata.gz: d26b0547dda1867f0930c15d9c03bc29332e7ba76edd2f5c992008fad86b371515b32095a359b8d3654a104b0d677c80c188ed42845059f91411606492565ca7
7
- data.tar.gz: f20cdcfb5d63a48eea8b18d0270195fcebdad381593cf44e26ab58881b14e3fe5c04105aae0f6114d71da7018a909daf38b055cf8260d3cc396a8d4304012413
6
+ metadata.gz: 44916cd9440ba47737a567527755a085034c222e892e311ecc848a114634c25d44c81219ef1c58290e8b2d10ad18f23bdb57a939d9d84072cf3ef4a7665a9bf2
7
+ data.tar.gz: f19f4000b1250ddcccce85e6dcf4c0d3fde1c741f68f314da336525f228c619f15f98e682b8f3b059f2eed46c562033864582957ad149e3201e5cd21afb1b112
@@ -2,6 +2,12 @@
2
2
 
3
3
  _A description of your awesome changes here!_
4
4
 
5
+ ### 3.6.0 (2018-07-23)
6
+
7
+ Features:
8
+
9
+ - Allowed connections to take the exceptions in which to retry requests on (#79)
10
+
5
11
  ### 3.5.1 (2018-05-01)
6
12
 
7
13
  Bug fixes:
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Routemaster
2
2
  module Drain
3
- VERSION = '3.5.1'.freeze
3
+ VERSION = '3.6.0'.freeze
4
4
  end
5
5
  end
@@ -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.5.1
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-05-03 00:00:00.000000000 Z
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.7.6
290
+ rubygems_version: 2.6.11
291
291
  signing_key:
292
292
  specification_version: 4
293
293
  summary: Event receiver for the Routemaster bus