Class: LHC::DefaultTimeout

Inherits:
Interceptor show all
Includes:
ActiveSupport::Configurable
Defined in:
lib/lhc/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 LHC::Interceptor

Instance Method Details

#before_raw_requestObject



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

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