Skip to content
This repository was archived by the owner on Jan 30, 2024. It is now read-only.

Commit 2385cb4

Browse files
authored
Merge pull request #3 from ncreuschling/features/set-default-for-http_open_timeout
set default for http_open_timeout to satify `cap doctor`
2 parents 2c2849b + f800f13 commit 2385cb4

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

lib/capistrano/dkdeploy/php.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,9 @@
2121

2222
set :remote_opcache_file_name, 'opcache_reset.php'
2323
set :local_opcache_file, File.join(__dir__, '..', '..', '..', 'vendor', 'opcache_reset.php')
24+
25+
# timeouts for Net::HTTP
26+
set :http_open_timeout, nil
27+
set :http_read_timeout, 60
2428
end
2529
end

lib/dkdeploy/php/helpers/http.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ def http_get_with_redirect(url, limit = 5)
3737
raise 'too many HTTP redirects' if limit.zero?
3838
# configure Net::HTTP
3939
http = Net::HTTP.new(url.host, url.port)
40-
http.open_timeout = fetch :http_open_timeout, nil
41-
http.read_timeout = fetch :http_read_timeout, 60
40+
http.open_timeout = fetch :http_open_timeout
41+
http.read_timeout = fetch :http_read_timeout
4242
if url.scheme == 'https'
4343
http.use_ssl = true
4444
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

0 commit comments

Comments
 (0)