Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust the retry documentation and spec to align with implementation #1198

Merged
merged 1 commit into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/middleware/request/retry.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The middleware can also handle the [`Retry-After`](https://developer.mozilla.org
### Example Usage

This example will result in a first interval that is random between 0.05 and 0.075
and a second interval that is random between 0.1 and 0.15.
and a second interval that is random between 0.1 and 0.125.

```ruby
retry_options = {
Expand Down
2 changes: 1 addition & 1 deletion lib/faraday/request/retry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Request
# end
#
# This example will result in a first interval that is random between 0.05
# and 0.075 and a second interval that is random between 0.1 and 0.15.
# and 0.075 and a second interval that is random between 0.1 and 0.125.
class Retry < Faraday::Middleware
DEFAULT_EXCEPTIONS = [
Errno::ETIMEDOUT, 'Timeout::Error',
Expand Down
2 changes: 1 addition & 1 deletion spec/faraday/request/retry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
let(:options) { { max: 2, interval: 0.1, interval_randomness: 0.05 } }
let(:middleware) { Faraday::Request::Retry.new(nil, options) }

it { expect(middleware.send(:calculate_retry_interval, 2)).to be_between(0.1, 0.15) }
it { expect(middleware.send(:calculate_retry_interval, 2)).to be_between(0.1, 0.105) }
end
end

Expand Down