Class: DHC::DefaultTimeout

Inherits:
Interceptor show all
Includes:
ActiveSupport::Configurable
Defined in:
lib/dhc/interceptors/default_timeout.rb

Constant Summary collapse

CONNECTTIMEOUT =

seconds

2
TIMEOUT =

seconds

15

Instance Attribute Summary

Attributes inherited from Interceptor

#request

Instance Method Summary collapse

Methods inherited from Interceptor

#after_request, #after_response, #all_interceptor_classes, #before_request, #before_response, dup, #initialize, #response

Constructor Details

This class inherits a constructor from DHC::Interceptor

Instance Method Details

#before_initObject



11
12
13
14
15
# File 'lib/dhc/interceptors/default_timeout.rb', line 11

def before_init
  request_options = request.options || {}
  request_options[:timeout] ||= timeout || TIMEOUT
  request_options[:connecttimeout] ||= connecttimeout || CONNECTTIMEOUT
end