faraday-retry 1.0.3 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +39 -0
- data/README.md +58 -12
- data/lib/faraday/retry/middleware.rb +69 -36
- data/lib/faraday/retry/retryable.rb +46 -0
- data/lib/faraday/retry/version.rb +1 -1
- data/lib/faraday/retry.rb +1 -0
- metadata +134 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e0d25040c1d5a44f97588ae549113ddc1f5605575982a9914bbcf04ba75479e
|
4
|
+
data.tar.gz: 9894f02b5c148166cf87eba7b80399ab52d6ab52d62a754c7cdb923cb77b55d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6166b5f81ddc21739eb1654a2e8aa55191ecb275f4299d752980df1b7220c7698703fadeee074454da963ca0877dd00283105f0e1f423e6043735f042c984ea2
|
7
|
+
data.tar.gz: c6e11e52b1007c9dc6bca895b89a06638b4269bc7f19f89d5916e6c81136958c49f2095dd6cc8bc2e1391ba4dcd47d5879931cdf19a68a8f0608a0e11c82bc05
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,37 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## Unreleased
|
4
|
+
|
5
|
+
_nothing yet_
|
6
|
+
|
7
|
+
## v2.2.1 (2024-04-15)
|
8
|
+
|
9
|
+
* Avoid deprecation warning about ::UploadIO constant when used without faraday-multipart gem [PR #37](https://github.com/lostisland/faraday-retry/pull/37) [@iMacTia]
|
10
|
+
* Documentation update [PR #30](https://github.com/lostisland/faraday-retry/pull/30) [@olleolleolle]
|
11
|
+
* Documentation update [PR #32](https://github.com/lostisland/faraday-retry/pull/32) Thanks, [@Drowze]!
|
12
|
+
|
13
|
+
## v2.2.0 (2023-06-01)
|
14
|
+
|
15
|
+
* Support new `header_parser_block` option. [PR #28](https://github.com/lostisland/faraday-retry/pull/28). Thanks, [@zavan]!
|
16
|
+
|
17
|
+
## v2.1.0 (2023-03-03)
|
18
|
+
|
19
|
+
* Support for custom RateLimit headers. [PR #13](https://github.com/lostisland/faraday-retry/pull/13). Thanks, [@brookemckim]!
|
20
|
+
|
21
|
+
v2.1.1 (2023-02-17) is a spurious not-released version that you may have seen mentioned in this CHANGELOG.
|
22
|
+
|
23
|
+
## v2.0.0 (2022-06-08)
|
24
|
+
|
25
|
+
### Changed
|
26
|
+
|
27
|
+
* `retry_block` now takes keyword arguments instead of positional (backwards incompatible)
|
28
|
+
* `retry_block`'s `retry_count` argument now counts up from 0, instead of old `retries_remaining`
|
29
|
+
|
30
|
+
### Added
|
31
|
+
|
32
|
+
* Support for the `RateLimit-Reset` header. [PR #9](https://github.com/lostisland/faraday-retry/pull/9). Thanks, [@maxprokopiev]!
|
33
|
+
* `retry_block` has additional `will_retry_in` argument with upcoming delay before retry in seconds.
|
34
|
+
|
3
35
|
## v1.0
|
4
36
|
|
5
37
|
Initial release.
|
@@ -8,3 +40,10 @@ This release consists of the same middleware that was previously bundled with Fa
|
|
8
40
|
### Fixed
|
9
41
|
|
10
42
|
* Retry middleware `retry_block` is not called if retry will not happen due to `max_interval`, https://github.com/lostisland/faraday/pull/1350
|
43
|
+
|
44
|
+
[@maxprokopiev]: https://github.com/maxprokopiev
|
45
|
+
[@brookemckim]: https://github.com/brookemckim
|
46
|
+
[@zavan]: https://github.com/zavan
|
47
|
+
[@Drowze]: https://github.com/Drowze
|
48
|
+
[@olleolleolle]: https://github.com/olleolleolle
|
49
|
+
[@iMacTia]: https://github.com/iMacTia
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Faraday Retry
|
2
2
|
|
3
|
-
[](https://github.com/lostisland/faraday-retry/actions/workflows/ci.yml)
|
4
4
|
[](https://rubygems.org/gems/faraday-retry)
|
5
5
|
[](LICENSE.md)
|
6
6
|
|
@@ -75,7 +75,7 @@ retry_options = {
|
|
75
75
|
#### Specify which exceptions should trigger a retry
|
76
76
|
|
77
77
|
You can provide an `exceptions` option with a list of exceptions that will replace
|
78
|
-
the default
|
78
|
+
the default exceptions: `Errno::ETIMEDOUT`, `Timeout::Error`, `Faraday::TimeoutError`, `Faraday::Error::RetriableResponse`.
|
79
79
|
This can be particularly useful when combined with the [RaiseError][raise_error] middleware.
|
80
80
|
|
81
81
|
```ruby
|
@@ -84,6 +84,14 @@ retry_options = {
|
|
84
84
|
}
|
85
85
|
```
|
86
86
|
|
87
|
+
If you want to inherit default exceptions, do it this way.
|
88
|
+
|
89
|
+
```ruby
|
90
|
+
retry_options = {
|
91
|
+
exceptions: Faraday::Retry::Middleware::DEFAULT_EXCEPTIONS + [Faraday::ResourceNotFound, Faraday::UnauthorizedError]
|
92
|
+
}
|
93
|
+
```
|
94
|
+
|
87
95
|
#### Specify on which response statuses to retry
|
88
96
|
|
89
97
|
By default the `Retry` middleware will only retry the request if one of the expected exceptions arise.
|
@@ -96,11 +104,14 @@ retry_options = {
|
|
96
104
|
}
|
97
105
|
```
|
98
106
|
|
99
|
-
#### Automatically handle the `Retry-After`
|
107
|
+
#### Automatically handle the `Retry-After` and `RateLimit-Reset` headers
|
100
108
|
|
101
|
-
Some APIs, like the [Slack API](https://api.slack.com/docs/rate-limits), will inform you when you reach their API limits by replying with a response status code of `429`
|
109
|
+
Some APIs, like the [Slack API](https://api.slack.com/docs/rate-limits), will inform you when you reach their API limits by replying with a response status code of `429`
|
110
|
+
and a response header of `Retry-After` containing a time in seconds. You should then only retry querying after the amount of time provided by the `Retry-After` header,
|
111
|
+
otherwise you won't get a response. Other APIs communicate their rate limits via the [RateLimit-xxx](https://www.ietf.org/archive/id/draft-ietf-httpapi-ratelimit-headers-05.html#name-providing-ratelimit-fields) headers
|
112
|
+
where `RateLimit-Reset` behaves similarly to the `Retry-After`.
|
102
113
|
|
103
|
-
You can automatically handle
|
114
|
+
You can automatically handle both headers and have Faraday pause and retry for the right amount of time by including the `429` status code in the retry statuses list:
|
104
115
|
|
105
116
|
```ruby
|
106
117
|
retry_options = {
|
@@ -108,6 +119,17 @@ retry_options = {
|
|
108
119
|
}
|
109
120
|
```
|
110
121
|
|
122
|
+
If you are working with an API which does not comply with the Rate Limit RFC you can specify custom headers to be used for retry and reset, as well as a block to parse the headers:
|
123
|
+
|
124
|
+
```ruby
|
125
|
+
retry_options = {
|
126
|
+
retry_statuses: [429],
|
127
|
+
rate_limit_retry_header: 'x-rate-limit-retry-after',
|
128
|
+
rate_limit_reset_header: 'x-rate-limit-reset',
|
129
|
+
header_parser_block: ->(value) { Time.at(value.to_i).utc - Time.now.utc }
|
130
|
+
}
|
131
|
+
```
|
132
|
+
|
111
133
|
#### Specify a custom retry logic
|
112
134
|
|
113
135
|
You can also specify a custom retry logic with the `retry_if` option.
|
@@ -127,15 +149,38 @@ retry_options = {
|
|
127
149
|
|
128
150
|
### Call a block on every retry
|
129
151
|
|
130
|
-
You can specify a
|
131
|
-
There are many different applications for this feature,
|
132
|
-
|
152
|
+
You can specify a proc object through the `retry_block` option that will be called before every retry.
|
153
|
+
There are many different applications for this feature, ranging from instrumentation to monitoring.
|
154
|
+
|
155
|
+
The block is passed keyword arguments with contextual information: Request environment, middleware options, current number of retries, exception, and amount of time we will wait before retrying. (retry_block is called before the wait time happens)
|
156
|
+
|
133
157
|
For example, you might want to keep track of the response statuses:
|
134
158
|
|
135
159
|
```ruby
|
136
160
|
response_statuses = []
|
137
161
|
retry_options = {
|
138
|
-
retry_block: -> (env
|
162
|
+
retry_block: -> (env:, options:, retry_count:, exception:, will_retry_in:) { response_statuses << env.status }
|
163
|
+
}
|
164
|
+
```
|
165
|
+
|
166
|
+
### Call a block after retries have been exhausted
|
167
|
+
|
168
|
+
You can specify a lambda object through the `exhausted_retries_block` option that will be called after all retries are exhausted.
|
169
|
+
This block will be called once.
|
170
|
+
|
171
|
+
The block is passed keyword arguments with contextual information and passed your data:
|
172
|
+
* Request environment,
|
173
|
+
* exception,
|
174
|
+
* middleware options
|
175
|
+
* and your data.
|
176
|
+
|
177
|
+
In a lambda you can pass any logic for further work.
|
178
|
+
|
179
|
+
For example, you might want to update user by request query.
|
180
|
+
|
181
|
+
```ruby
|
182
|
+
retry_options = {
|
183
|
+
exhausted_retries_block: -> (user_id:, env:, exception:, options:) { User.find_by!(id: user_id).do_admin! }
|
139
184
|
}
|
140
185
|
```
|
141
186
|
|
@@ -147,8 +192,9 @@ Then, run `bin/test` to run the tests.
|
|
147
192
|
|
148
193
|
To install this gem onto your local machine, run `rake build`.
|
149
194
|
|
150
|
-
|
151
|
-
|
195
|
+
### Releasing a new version
|
196
|
+
|
197
|
+
To release a new version, make a commit with a message such as "Bumped to 0.0.2", and change the _Unreleased_ heading in `CHANGELOG.md` to a heading like "0.0.2 (2022-01-01)", and then use GitHub Releases to author a release. A GitHub Actions workflow then publishes a new gem to [RubyGems.org](https://rubygems.org/gems/faraday-retry).
|
152
198
|
|
153
199
|
## Contributing
|
154
200
|
|
@@ -158,4 +204,4 @@ Bug reports and pull requests are welcome on [GitHub](https://github.com/lostisl
|
|
158
204
|
|
159
205
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
160
206
|
|
161
|
-
[raise_error]: https://lostisland.github.io/faraday
|
207
|
+
[raise_error]: https://lostisland.github.io/faraday/#/middleware/included/raising-errors
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative 'retryable'
|
4
|
+
|
3
5
|
module Faraday
|
4
6
|
module Retry
|
5
7
|
# This class provides the main implementation for your middleware.
|
@@ -15,6 +17,8 @@ module Faraday
|
|
15
17
|
# (see "retry" middleware: https://github.com/lostisland/faraday/blob/main/lib/faraday/request/retry.rb#L142).
|
16
18
|
# IMPORTANT: Remember to call `@app.call(env)` or `super` to not interrupt the middleware chain!
|
17
19
|
class Middleware < Faraday::Middleware
|
20
|
+
include Retryable
|
21
|
+
|
18
22
|
DEFAULT_EXCEPTIONS = [
|
19
23
|
Errno::ETIMEDOUT, 'Timeout::Error',
|
20
24
|
Faraday::TimeoutError, Faraday::RetriableResponse
|
@@ -26,7 +30,9 @@ module Faraday
|
|
26
30
|
:interval_randomness,
|
27
31
|
:backoff_factor, :exceptions,
|
28
32
|
:methods, :retry_if, :retry_block,
|
29
|
-
:retry_statuses
|
33
|
+
:retry_statuses, :rate_limit_retry_header,
|
34
|
+
:rate_limit_reset_header, :header_parser_block,
|
35
|
+
:exhausted_retries_block)
|
30
36
|
|
31
37
|
DEFAULT_CHECK = ->(_env, _exception) { false }
|
32
38
|
|
@@ -71,12 +77,16 @@ module Faraday
|
|
71
77
|
end
|
72
78
|
|
73
79
|
def retry_block
|
74
|
-
self[:retry_block] ||= proc {}
|
80
|
+
self[:retry_block] ||= proc {}
|
75
81
|
end
|
76
82
|
|
77
83
|
def retry_statuses
|
78
84
|
Array(self[:retry_statuses] ||= [])
|
79
85
|
end
|
86
|
+
|
87
|
+
def exhausted_retries_block
|
88
|
+
self[:exhausted_retries_block] ||= proc {}
|
89
|
+
end
|
80
90
|
end
|
81
91
|
|
82
92
|
# @param app [#call]
|
@@ -94,8 +104,8 @@ module Faraday
|
|
94
104
|
# 'Timeout::Error', Faraday::TimeoutError, Faraday::RetriableResponse])
|
95
105
|
# The list of exceptions to handle. Exceptions can be given as
|
96
106
|
# Class, Module, or String.
|
97
|
-
# @option options [Array] :methods (the idempotent HTTP methods
|
98
|
-
# in IDEMPOTENT_METHODS) A list of HTTP methods to retry without
|
107
|
+
# @option options [Array<Symbol>] :methods (the idempotent HTTP methods
|
108
|
+
# in IDEMPOTENT_METHODS) A list of HTTP methods, as symbols, to retry without
|
99
109
|
# calling retry_if. Pass an empty Array to call retry_if
|
100
110
|
# for all exceptions.
|
101
111
|
# @option options [Block] :retry_if (false) block that will receive
|
@@ -105,12 +115,31 @@ module Faraday
|
|
105
115
|
# if the exception produced is non-recoverable or if the
|
106
116
|
# the HTTP method called is not idempotent.
|
107
117
|
# @option options [Block] :retry_block block that is executed before
|
108
|
-
# every retry.
|
109
|
-
#
|
118
|
+
# every retry. The block will be yielded keyword arguments:
|
119
|
+
# * env [Faraday::Env]: Request environment
|
120
|
+
# * options [Faraday::Options]: middleware options
|
121
|
+
# * retry_count [Integer]: how many retries have already occured (starts at 0)
|
122
|
+
# * exception [Exception]: exception that triggered the retry,
|
123
|
+
# will be the synthetic `Faraday::RetriableResponse` if the
|
124
|
+
# retry was triggered by something other than an exception.
|
125
|
+
# * will_retry_in [Float]: retry_block is called *before* the retry
|
126
|
+
# delay, actual retry will happen in will_retry_in number of
|
127
|
+
# seconds.
|
110
128
|
# @option options [Array] :retry_statuses Array of Integer HTTP status
|
111
129
|
# codes or a single Integer value that determines whether to raise
|
112
130
|
# a Faraday::RetriableResponse exception based on the HTTP status code
|
113
131
|
# of an HTTP response.
|
132
|
+
# @option options [Block] :header_parser_block block that will receive
|
133
|
+
# the the value of the retry header and should return the number of
|
134
|
+
# seconds to wait before retrying the request. This is useful if the
|
135
|
+
# value of the header is not a number of seconds or a RFC 2822 formatted date.
|
136
|
+
# @option options [Block] :exhausted_retries_block block will receive
|
137
|
+
# when all attempts are exhausted. The block will be yielded keyword arguments:
|
138
|
+
# * env [Faraday::Env]: Request environment
|
139
|
+
# * exception [Exception]: exception that triggered the retry,
|
140
|
+
# will be the synthetic `Faraday::RetriableResponse` if the
|
141
|
+
# retry was triggered by something other than an exception.
|
142
|
+
# * options [Faraday::Options]: middleware options
|
114
143
|
def initialize(app, options = nil)
|
115
144
|
super(app)
|
116
145
|
@options = Options.from(options)
|
@@ -118,7 +147,7 @@ module Faraday
|
|
118
147
|
end
|
119
148
|
|
120
149
|
def calculate_sleep_amount(retries, env)
|
121
|
-
retry_after = calculate_retry_after(env)
|
150
|
+
retry_after = [calculate_retry_after(env), calculate_rate_limit_reset(env)].compact.max
|
122
151
|
retry_interval = calculate_retry_interval(retries)
|
123
152
|
|
124
153
|
return if retry_after && retry_after > @options.max_interval
|
@@ -134,26 +163,14 @@ module Faraday
|
|
134
163
|
def call(env)
|
135
164
|
retries = @options.max
|
136
165
|
request_body = env[:body]
|
137
|
-
|
166
|
+
|
167
|
+
with_retries(env: env, options: @options, retries: retries, body: request_body, errmatch: @errmatch) do
|
138
168
|
# after failure env[:body] is set to the response body
|
139
169
|
env[:body] = request_body
|
170
|
+
|
140
171
|
@app.call(env).tap do |resp|
|
141
172
|
raise Faraday::RetriableResponse.new(nil, resp) if @options.retry_statuses.include?(resp.status)
|
142
173
|
end
|
143
|
-
rescue @errmatch => e
|
144
|
-
if retries.positive? && retry_request?(env, e)
|
145
|
-
retries -= 1
|
146
|
-
rewind_files(request_body)
|
147
|
-
if (sleep_amount = calculate_sleep_amount(retries + 1, env))
|
148
|
-
@options.retry_block.call(env, @options, retries, e)
|
149
|
-
sleep sleep_amount
|
150
|
-
retry
|
151
|
-
end
|
152
|
-
end
|
153
|
-
|
154
|
-
raise unless e.is_a?(Faraday::RetriableResponse)
|
155
|
-
|
156
|
-
e.response
|
157
174
|
end
|
158
175
|
end
|
159
176
|
|
@@ -190,29 +207,26 @@ module Faraday
|
|
190
207
|
end
|
191
208
|
|
192
209
|
def rewind_files(body)
|
193
|
-
return unless defined?(UploadIO)
|
210
|
+
return unless defined?(Faraday::UploadIO)
|
194
211
|
return unless body.is_a?(Hash)
|
195
212
|
|
196
213
|
body.each do |_, value|
|
197
|
-
value.rewind if value.is_a?(UploadIO)
|
214
|
+
value.rewind if value.is_a?(Faraday::UploadIO)
|
198
215
|
end
|
199
216
|
end
|
200
217
|
|
218
|
+
# RFC for RateLimit Header Fields for HTTP:
|
219
|
+
# https://www.ietf.org/archive/id/draft-ietf-httpapi-ratelimit-headers-05.html#name-fields-definition
|
220
|
+
def calculate_rate_limit_reset(env)
|
221
|
+
reset_header = @options.rate_limit_reset_header || 'RateLimit-Reset'
|
222
|
+
parse_retry_header(env, reset_header)
|
223
|
+
end
|
224
|
+
|
201
225
|
# MDN spec for Retry-After header:
|
202
226
|
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
|
203
227
|
def calculate_retry_after(env)
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
retry_after_value = env[:response_headers]['Retry-After']
|
208
|
-
|
209
|
-
# Try to parse date from the header value
|
210
|
-
begin
|
211
|
-
datetime = DateTime.rfc2822(retry_after_value)
|
212
|
-
datetime.to_time - Time.now.utc
|
213
|
-
rescue ArgumentError
|
214
|
-
retry_after_value.to_f
|
215
|
-
end
|
228
|
+
retry_header = @options.rate_limit_retry_header || 'Retry-After'
|
229
|
+
parse_retry_header(env, retry_header)
|
216
230
|
end
|
217
231
|
|
218
232
|
def calculate_retry_interval(retries)
|
@@ -225,6 +239,25 @@ module Faraday
|
|
225
239
|
|
226
240
|
current_interval + random_interval
|
227
241
|
end
|
242
|
+
|
243
|
+
def parse_retry_header(env, header)
|
244
|
+
response_headers = env[:response_headers]
|
245
|
+
return unless response_headers
|
246
|
+
|
247
|
+
retry_after_value = env[:response_headers][header]
|
248
|
+
|
249
|
+
if @options.header_parser_block
|
250
|
+
@options.header_parser_block.call(retry_after_value)
|
251
|
+
else
|
252
|
+
# Try to parse date from the header value
|
253
|
+
begin
|
254
|
+
datetime = DateTime.rfc2822(retry_after_value)
|
255
|
+
datetime.to_time - Time.now.utc
|
256
|
+
rescue ArgumentError
|
257
|
+
retry_after_value.to_f
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
228
261
|
end
|
229
262
|
end
|
230
263
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Faraday
|
4
|
+
# Adds the ability to retry a request based on settings and errors that have occurred.
|
5
|
+
module Retryable
|
6
|
+
def with_retries(env:, options:, retries:, body:, errmatch:)
|
7
|
+
yield
|
8
|
+
rescue errmatch => e
|
9
|
+
exhausted_retries(options, env, e) if retries_zero?(retries, env, e)
|
10
|
+
|
11
|
+
if retries.positive? && retry_request?(env, e)
|
12
|
+
retries -= 1
|
13
|
+
rewind_files(body)
|
14
|
+
if (sleep_amount = calculate_sleep_amount(retries + 1, env))
|
15
|
+
options.retry_block.call(
|
16
|
+
env: env,
|
17
|
+
options: options,
|
18
|
+
retry_count: options.max - (retries + 1),
|
19
|
+
exception: e,
|
20
|
+
will_retry_in: sleep_amount
|
21
|
+
)
|
22
|
+
sleep sleep_amount
|
23
|
+
retry
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
raise unless e.is_a?(Faraday::RetriableResponse)
|
28
|
+
|
29
|
+
e.response
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def retries_zero?(retries, env, exception)
|
35
|
+
retries.zero? && retry_request?(env, exception)
|
36
|
+
end
|
37
|
+
|
38
|
+
def exhausted_retries(options, env, exception)
|
39
|
+
options.exhausted_retries_block.call(
|
40
|
+
env: env,
|
41
|
+
exception: exception,
|
42
|
+
options: options
|
43
|
+
)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/lib/faraday/retry.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,140 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday-retry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mattia Giuffrida
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
|
+
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: faraday
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - "~>"
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '2.0'
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - "~>"
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '2.0'
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: bundler
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - "~>"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '2.0'
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: rake
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '13.0'
|
47
|
+
type: :development
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '13.0'
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: rspec
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '3.0'
|
61
|
+
type: :development
|
62
|
+
prerelease: false
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '3.0'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: simplecov
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 0.21.0
|
75
|
+
type: :development
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 0.21.0
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: rubocop
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 1.21.0
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 1.21.0
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: rubocop-packaging
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 0.5.0
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.5.0
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: rubocop-performance
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '1.0'
|
117
|
+
type: :development
|
118
|
+
prerelease: false
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '1.0'
|
124
|
+
- !ruby/object:Gem::Dependency
|
125
|
+
name: rubocop-rspec
|
126
|
+
requirement: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '2.0'
|
131
|
+
type: :development
|
132
|
+
prerelease: false
|
133
|
+
version_requirements: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "~>"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '2.0'
|
13
138
|
description: 'Catches exceptions and retries each request a limited number of times.
|
14
139
|
|
15
140
|
'
|
@@ -25,18 +150,17 @@ files:
|
|
25
150
|
- lib/faraday/retriable_response.rb
|
26
151
|
- lib/faraday/retry.rb
|
27
152
|
- lib/faraday/retry/middleware.rb
|
153
|
+
- lib/faraday/retry/retryable.rb
|
28
154
|
- lib/faraday/retry/version.rb
|
29
155
|
homepage: https://github.com/lostisland/faraday-retry
|
30
156
|
licenses:
|
31
157
|
- MIT
|
32
158
|
metadata:
|
33
159
|
bug_tracker_uri: https://github.com/lostisland/faraday-retry/issues
|
34
|
-
changelog_uri: https://github.com/lostisland/faraday-retry/blob/
|
35
|
-
documentation_uri: http://www.rubydoc.info/gems/faraday-retry/
|
160
|
+
changelog_uri: https://github.com/lostisland/faraday-retry/blob/v2.3.2/CHANGELOG.md
|
161
|
+
documentation_uri: http://www.rubydoc.info/gems/faraday-retry/2.3.2
|
36
162
|
homepage_uri: https://github.com/lostisland/faraday-retry
|
37
163
|
source_code_uri: https://github.com/lostisland/faraday-retry
|
38
|
-
wiki_uri: https://github.com/lostisland/faraday-retry/wiki
|
39
|
-
post_install_message:
|
40
164
|
rdoc_options: []
|
41
165
|
require_paths:
|
42
166
|
- lib
|
@@ -44,7 +168,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
44
168
|
requirements:
|
45
169
|
- - ">="
|
46
170
|
- !ruby/object:Gem::Version
|
47
|
-
version: '2.
|
171
|
+
version: '2.6'
|
48
172
|
- - "<"
|
49
173
|
- !ruby/object:Gem::Version
|
50
174
|
version: '4'
|
@@ -54,8 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
178
|
- !ruby/object:Gem::Version
|
55
179
|
version: '0'
|
56
180
|
requirements: []
|
57
|
-
rubygems_version: 3.
|
58
|
-
signing_key:
|
181
|
+
rubygems_version: 3.6.7
|
59
182
|
specification_version: 4
|
60
183
|
summary: Catches exceptions and retries each request a limited number of times
|
61
184
|
test_files: []
|