Sha256: 7184bbe3e29f3a8ae0169a13ce406ad6aa85a51a13d8092d38ed51c507e6ba83

Contents?: true

Size: 425 Bytes

Versions: 49

Compression:

Stored size: 425 Bytes

Contents

# frozen_string_literal: true

class LHC::DefaultTimeout < LHC::Interceptor
  include ActiveSupport::Configurable

  config_accessor :timeout, :connecttimeout

  CONNECTTIMEOUT = 2 # seconds
  TIMEOUT = 15 # seconds

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

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
lhc-15.2.1 lib/lhc/interceptors/default_timeout.rb
lhc-15.2.0 lib/lhc/interceptors/default_timeout.rb
lhc-15.1.3 lib/lhc/interceptors/default_timeout.rb
lhc-15.1.2 lib/lhc/interceptors/default_timeout.rb
lhc-15.1.1 lib/lhc/interceptors/default_timeout.rb
lhc-15.1.0 lib/lhc/interceptors/default_timeout.rb
lhc-16.0.0.pre.pro2162.2 lib/lhc/interceptors/default_timeout.rb
lhc-16.0.0.pre.pro2162 lib/lhc/interceptors/default_timeout.rb
lhc-15.0.1 lib/lhc/interceptors/default_timeout.rb
lhc-15.0.0 lib/lhc/interceptors/default_timeout.rb
lhc-14.0.0 lib/lhc/interceptors/default_timeout.rb
lhc-13.4.0.pre.pro1766.1 lib/lhc/interceptors/default_timeout.rb
lhc-13.2.0 lib/lhc/interceptors/default_timeout.rb
lhc-13.1.0 lib/lhc/interceptors/default_timeout.rb
lhc-13.0.0 lib/lhc/interceptors/default_timeout.rb
lhc-12.3.0 lib/lhc/interceptors/default_timeout.rb
lhc-12.2.1 lib/lhc/interceptors/default_timeout.rb
lhc-12.2.0 lib/lhc/interceptors/default_timeout.rb
lhc-12.1.3 lib/lhc/interceptors/default_timeout.rb
lhc-12.1.2 lib/lhc/interceptors/default_timeout.rb