faraday-retry 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +10 -4
- data/lib/faraday/retry/middleware.rb +4 -4
- data/lib/faraday/retry/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4215b6f0b7dd61fa8702103e77d6373cace2c46b469defeb0ed93ce94aa26e6c
|
4
|
+
data.tar.gz: 295faca61565e49a36a7f03201d6aee90b6a353c40d22a8bf8e1f6b1c729c041
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b8f2bee0e35492efc578659ce28a0b947374c8cafdba07606d953c417e8844128248a639392e4ad60c682528c0d478d3a894ca688e1f72965172633aee3be7f
|
7
|
+
data.tar.gz: 148ac2094f76cd59ea9278a4d1948b3211f0c2abc1876b6f10fbdd88a384257dfdfab33f9a1cf102ed23352b5b0dd2e9f1f4d533cd8459c4b86d1f5e7578a053
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## Unreleased
|
4
|
+
|
5
|
+
* Avoid deprecation warning about ::UploadIO constant when used without faraday-multipart gem [PR #37](https://github.com/lostisland/faraday-retry/pull/37) [@iMacTia]
|
6
|
+
* Documentation update [PR #30](https://github.com/lostisland/faraday-retry/pull/30) [@olleolleolle]
|
7
|
+
* Documentation update [PR #32](https://github.com/lostisland/faraday-retry/pull/32) Thanks, [@Drowze]!
|
8
|
+
|
3
9
|
## v2.2.0 (2023-06-01)
|
4
10
|
|
5
11
|
* Support new `header_parser_block` option. [PR #28](https://github.com/lostisland/faraday-retry/pull/28). Thanks, [@zavan]!
|
@@ -34,3 +40,6 @@ This release consists of the same middleware that was previously bundled with Fa
|
|
34
40
|
[@maxprokopiev]: https://github.com/maxprokopiev
|
35
41
|
[@brookemckim]: https://github.com/brookemckim
|
36
42
|
[@zavan]: https://github.com/zavan
|
43
|
+
[@Drowze]: https://github.com/Drowze
|
44
|
+
[@olleolleolle]: https://github.com/olleolleolle
|
45
|
+
[@iMacTia]: https://github.com/iMacTia
|
data/README.md
CHANGED
@@ -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.
|
@@ -144,10 +152,8 @@ retry_options = {
|
|
144
152
|
You can specify a proc object through the `retry_block` option that will be called before every
|
145
153
|
retry, before There are many different applications for this feature, spacing from instrumentation to monitoring.
|
146
154
|
|
147
|
-
|
148
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)
|
149
156
|
|
150
|
-
|
151
157
|
For example, you might want to keep track of the response statuses:
|
152
158
|
|
153
159
|
```ruby
|
@@ -177,4 +183,4 @@ Bug reports and pull requests are welcome on [GitHub](https://github.com/lostisl
|
|
177
183
|
|
178
184
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
179
185
|
|
180
|
-
[raise_error]: https://lostisland.github.io/faraday
|
186
|
+
[raise_error]: https://lostisland.github.io/faraday/#/middleware/included/raising-errors
|
@@ -95,8 +95,8 @@ module Faraday
|
|
95
95
|
# 'Timeout::Error', Faraday::TimeoutError, Faraday::RetriableResponse])
|
96
96
|
# The list of exceptions to handle. Exceptions can be given as
|
97
97
|
# Class, Module, or String.
|
98
|
-
# @option options [Array] :methods (the idempotent HTTP methods
|
99
|
-
# in IDEMPOTENT_METHODS) A list of HTTP methods to retry without
|
98
|
+
# @option options [Array<Symbol>] :methods (the idempotent HTTP methods
|
99
|
+
# in IDEMPOTENT_METHODS) A list of HTTP methods, as symbols, to retry without
|
100
100
|
# calling retry_if. Pass an empty Array to call retry_if
|
101
101
|
# for all exceptions.
|
102
102
|
# @option options [Block] :retry_if (false) block that will receive
|
@@ -209,11 +209,11 @@ module Faraday
|
|
209
209
|
end
|
210
210
|
|
211
211
|
def rewind_files(body)
|
212
|
-
return unless defined?(UploadIO)
|
212
|
+
return unless defined?(Faraday::UploadIO)
|
213
213
|
return unless body.is_a?(Hash)
|
214
214
|
|
215
215
|
body.each do |_, value|
|
216
|
-
value.rewind if value.is_a?(UploadIO)
|
216
|
+
value.rewind if value.is_a?(Faraday::UploadIO)
|
217
217
|
end
|
218
218
|
end
|
219
219
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday-retry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mattia Giuffrida
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -157,8 +157,8 @@ licenses:
|
|
157
157
|
- MIT
|
158
158
|
metadata:
|
159
159
|
bug_tracker_uri: https://github.com/lostisland/faraday-retry/issues
|
160
|
-
changelog_uri: https://github.com/lostisland/faraday-retry/blob/v2.2.
|
161
|
-
documentation_uri: http://www.rubydoc.info/gems/faraday-retry/2.2.
|
160
|
+
changelog_uri: https://github.com/lostisland/faraday-retry/blob/v2.2.1/CHANGELOG.md
|
161
|
+
documentation_uri: http://www.rubydoc.info/gems/faraday-retry/2.2.1
|
162
162
|
homepage_uri: https://github.com/lostisland/faraday-retry
|
163
163
|
source_code_uri: https://github.com/lostisland/faraday-retry
|
164
164
|
post_install_message:
|