oauth icon indicating copy to clipboard operation
oauth copied to clipboard

Ability to increase Net::HTTP read_timeout

Open KieranP opened this issue 12 years ago • 1 comments

Requests that take a while to return end up timing out waiting for response. This can be problematic if the request takes more than the default timeout.

It would be nice to set a custom read_timeout for the Net::HTTP object created in consumer.rb#create_http

Here are some related resources: http://www.ruby-doc.org/stdlib-1.9.3/libdoc/net/http/rdoc/Net/HTTP.html#method-i-read_timeout-3D https://groups.google.com/forum/?fromgroups=#!topic/rubyonrails-talk/_byV2ua39fI

It would be handy to be able to do something like this:

@consumer = ::OAuth::Consumer.new(..., ..., { :timeout => 120 })

KieranP avatar Oct 28 '12 21:10 KieranP

@KieranP, using the current version, the code snippet below will modify both the read_time and open_timeout.

OAuth::Consumer.new(key, secret, timeout: 120)

mikeantonelli avatar Jun 06 '13 21:06 mikeantonelli