Skip to content

Commit

Permalink
Fix incorrect connect timeout in outgoing requests (#26116)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire committed Jul 22, 2023
1 parent f2c6833 commit 0078e7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/lib/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,11 @@ def open(host, *args)
end

until socks.empty?
_, available_socks, = IO.select(nil, socks, nil, Request::TIMEOUT[:connect])
_, available_socks, = IO.select(nil, socks, nil, Request::TIMEOUT[:connect_timeout])

if available_socks.nil?
socks.each(&:close)
raise HTTP::TimeoutError, "Connect timed out after #{Request::TIMEOUT[:connect]} seconds"
raise HTTP::TimeoutError, "Connect timed out after #{Request::TIMEOUT[:connect_timeout]} seconds"
end

available_socks.each do |sock|
Expand Down

0 comments on commit 0078e7e

Please sign in to comment.