-
Notifications
You must be signed in to change notification settings - Fork 137
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
CI: Use same Ruby version matrix as Ruby, repair for Faraday 1.0 #228
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,11 @@ def initialize(app, options = nil) | |
super(app, options) | ||
|
||
# NOTE: Faraday 0.9.1 by default does not retry on POST requests | ||
@options.methods << :post | ||
@options.methods = @options.methods + [:post] | ||
|
||
# NOTE: the default exceptions are lost when custom ones are given | ||
default_exceptions = [ | ||
Errno::ETIMEDOUT, 'Timeout::Error', Error::TimeoutError] | ||
Errno::ETIMEDOUT, 'Timeout::Error', TimeoutError] | ||
@options.exceptions.concat(default_exceptions) | ||
end | ||
|
||
|
@@ -33,8 +33,10 @@ def call(env) | |
log(env, exception) | ||
retries -= 1 | ||
retries_header(env, retries) | ||
sleep sleep_amount(retries + 1) | ||
retry | ||
if (sleep_amount = calculate_sleep_amount(retries + 1, env)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's in the Faraday codebase. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps it's better to do a full replace of the retry middleware - than to patch this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, of course. |
||
sleep sleep_amount | ||
retry | ||
end | ||
end | ||
raise | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Could use
+=
but it's not objectively better or anything :)