Sha256: 686a4224ec8a195315810d5b3144a0190f1f506a204df8e9dbb612642849144b

Contents?: true

Size: 291 Bytes

Versions: 68

Compression:

Stored size: 291 Bytes

Contents

require "faraday/middleware"

module Searchkick
  class Middleware < Faraday::Middleware
    def call(env)
      if env[:method] == :get && env[:url].path.to_s.end_with?("/_search")
        env[:request][:timeout] = Searchkick.search_timeout
      end
      @app.call(env)
    end
  end
end

Version data entries

68 entries across 68 versions & 4 rubygems

Version Path
searchkick-1.3.3 lib/searchkick/middleware.rb
searchkick-1.3.2 lib/searchkick/middleware.rb
searchkick_bharthur-0.0.2 lib/searchkick/middleware.rb
searchkick_bharthur-0.0.1 lib/searchkick/middleware.rb
searchkick-1.3.1 lib/searchkick/middleware.rb
searchkick-1.3.0 lib/searchkick/middleware.rb
searchkick-1.2.1 lib/searchkick/middleware.rb
searchkick-1.2.0 lib/searchkick/middleware.rb