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

Improve retry middleware documentation. #1228

Merged
merged 1 commit into from Dec 31, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/middleware/request/retry.md
Expand Up @@ -110,7 +110,7 @@ retry_options = {

### Call a block on every retry

You can specify a block through the `retry_block` option that will be called every time the request is retried.
You can specify a block through the `retry_block` option that will be called before every retry.
There are many different applications for this feature, spacing from instrumentation to monitoring.
Request environment, middleware options, current number of retries and the exception is passed to the block as parameters.
For example, you might want to keep track of the response statuses:
Expand Down
2 changes: 1 addition & 1 deletion lib/faraday/request/retry.rb
Expand Up @@ -112,7 +112,7 @@ def retry_statuses
# not independent of the retry count. This would be useful
# if the exception produced is non-recoverable or if the
# the HTTP method called is not idempotent.
# @option options [Block] :retry_block block that is executed after
# @option options [Block] :retry_block block that is executed before
# every retry. Request environment, middleware options, current number
# of retries and the exception is passed to the block as parameters.
# @option options [Array] :retry_statuses Array of Integer HTTP status
Expand Down