From 049a35b94c607f557c5a609cb5b16b47971573ce Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 16 Feb 2015 13:40:10 +0100 Subject: [PATCH] Improved error handling. Set timeout for http calls. --- lib/user_agent.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/user_agent.rb b/lib/user_agent.rb index c67f8b339..240265a7a 100644 --- a/lib/user_agent.rb +++ b/lib/user_agent.rb @@ -43,6 +43,9 @@ returns http = Net::HTTP.new(uri.host, uri.port) + http.open_timeout = 8 + http.read_timeout = 8 + if uri.scheme =~ /https/i http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE