oauth
oauth copied to clipboard
Ability to increase Net::HTTP read_timeout
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, using the current version, the code snippet below will modify both the read_time and open_timeout.
OAuth::Consumer.new(key, secret, timeout: 120)