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-4.6.3 lib/searchkick/middleware.rb
searchkick-4.6.2 lib/searchkick/middleware.rb
searchkick-4.6.1 lib/searchkick/middleware.rb
searchkick-4.6.0 lib/searchkick/middleware.rb
searchkick-4.5.2 lib/searchkick/middleware.rb
searchkick-4.5.1 lib/searchkick/middleware.rb
searchkick-4.5.0 lib/searchkick/middleware.rb
searchkick-4.4.4 lib/searchkick/middleware.rb
searchkick-4.4.3 lib/searchkick/middleware.rb
searchkick-4.4.2 lib/searchkick/middleware.rb
searchkick-4.4.1 lib/searchkick/middleware.rb
searchkick-4.4.0 lib/searchkick/middleware.rb
searchkick-4.3.1 lib/searchkick/middleware.rb
searchkick-4.3.0 lib/searchkick/middleware.rb
searchkick-4.2.1 lib/searchkick/middleware.rb
searchkick-4.2.0 lib/searchkick/middleware.rb
searchkick-4.1.1 lib/searchkick/middleware.rb
searchkick-4.1.0 lib/searchkick/middleware.rb
searchkick-4.0.2 lib/searchkick/middleware.rb
searchkick-4.0.1 lib/searchkick/middleware.rb