Class: Searchkick::Middleware

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/searchkick/middleware.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object


5
6
7
8
9
10
# File 'lib/searchkick/middleware.rb', line 5

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