Skip to content

Commit fe3967a

Browse files
iangmaiaclaude
andcommitted
Pass timeouts to Net::HTTP.start so open_timeout applies to the connect phase
Setting open_timeout inside the start block is too late: the connection is already open by the time the block runs, so the 10s connect timeout never took effect (read_timeout was fine). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent ae2dca4 commit fe3967a

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

lib/fastlane/plugin/wpmreleasetoolkit/actions/common/update_apps_cdn_build_metadata.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ def self.update_single_post(site_id:, api_token:, post_id:, body:)
4646
request['Accept'] = 'application/json'
4747
request['Authorization'] = "Bearer #{api_token}"
4848

49-
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
50-
http.open_timeout = 10
51-
http.read_timeout = 30
49+
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https', open_timeout: 10, read_timeout: 30) do |http|
5250
http.request(request)
5351
end
5452

0 commit comments

Comments
 (0)