lib/dhc/interceptors/default_timeout.rb in dhc-1.0.0 vs lib/dhc/interceptors/default_timeout.rb in dhc-2.0.0
- old
+ new
@@ -6,10 +6,10 @@
config_accessor :timeout, :connecttimeout
CONNECTTIMEOUT = 2 # seconds
TIMEOUT = 15 # seconds
- def before_raw_request
+ def before_init
request_options = (request.options || {})
request_options[:timeout] ||= timeout || TIMEOUT
request_options[:connecttimeout] ||= connecttimeout || CONNECTTIMEOUT
end
end