-
Notifications
You must be signed in to change notification settings - Fork 983
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
read timeout request option (part 2) #1022
Merged
technoweenie
merged 22 commits into
master
from
springerigor-read-timeout-request-option
Oct 17, 2019
Merged
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
2597943
Add support for setting Ruby Net::HTTP `read_timeout` option separately
springerigor 3575ad6
Merge branch 'read-timeout-request-option' of https://github.com/spri…
technoweenie 956c53f
space things out a bit
technoweenie dbe4fae
teach Faraday::RequestOptions to get the correct timeout configuration
technoweenie abade0d
test current EMHttp timeout config
technoweenie 24cf49c
teach EMHttp adapter to use #fetch_timeout
technoweenie 6c117f4
test current Excon timeout config
technoweenie a5a398c
teach Excon to use #fetch_timeout
technoweenie 8dae875
lint
technoweenie b35f6a2
RequestOptions#fetch_timeout => Adapter#request_timeout
technoweenie 55c0b74
test current httpclient timeout behavior
technoweenie 711c257
teach httpclient adapter how to use #request_timeout
technoweenie 6394bc0
teach patron adapter how to use #request_timeout
technoweenie 0aea513
teach rack adapter to use #request_timeout
technoweenie b85589c
Merge branch 'master' into springerigor-read-timeout-request-option
technoweenie 18c204e
lint fixes
technoweenie 75b9804
unused
technoweenie 296f336
Update lib/faraday/adapter/net_http.rb
technoweenie a91581a
Update lib/faraday/adapter/net_http.rb
technoweenie 9de70e0
Merge branch 'master' into springerigor-read-timeout-request-option
iMacTia 48e6c3f
Merge branch 'master' into springerigor-read-timeout-request-option
iMacTia 68c53c4
prefer Hash#fetch
technoweenie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,17 +95,17 @@ def amend_opts_with_ssl!(opts, ssl) | |
end | ||
|
||
def amend_opts_with_timeouts!(opts, req) | ||
timeout = req[:timeout] | ||
return unless timeout | ||
if (sec = request_timeout(:read, req)) | ||
opts[:read_timeout] = sec | ||
end | ||
|
||
opts[:read_timeout] = timeout | ||
opts[:connect_timeout] = timeout | ||
opts[:write_timeout] = timeout | ||
if (sec = request_timeout(:write, req)) | ||
opts[:write_timeout] = sec | ||
end | ||
|
||
open_timeout = req[:open_timeout] | ||
return unless open_timeout | ||
return unless (sec = request_timeout(:open, req)) | ||
|
||
opts[:connect_timeout] = open_timeout | ||
opts[:connect_timeout] = sec | ||
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. Rubocop forced me to turn this into a guard check ^^^ |
||
end | ||
|
||
def amend_opts_with_proxy_settings!(opts, req) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could use a
key = TIMEOUT_KEYS.fetch(type) do ... end
and raise the error in there?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.
(We can do that in a follow-up PR, no biggie.)