Browse files

set a default but configurable timeout for all requests

  • Loading branch information...
1 parent 5e646b7 commit 349736cd388863cd7f8d9a3fb714eea3d86f1abf @technoweenie committed Jun 21, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/oauth/consumer.rb
View
4 lib/oauth/consumer.rb
@@ -317,6 +317,10 @@ def create_http(_url = nil)
else
http_object.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
+
+ http_object.read_timeout = http_object.open_timeout = @options[:timeout] || 30
+ http_object.open_timeout = @options[:open_timeout] if @options[:open_timeout]
+
http_object
end

0 comments on commit 349736c

Please sign in to comment.