Commit 54a67f30dd7e66f02fd6a97c8066553478a9a304

Authored by Andrew Kane
1 parent e59ea83a
Exists in master

Simplified timeout logic

Showing 1 changed file with 1 additions and 6 deletions   Show diff stats
lib/searchkick/query.rb
... ... @@ -505,12 +505,7 @@ module Searchkick
505 505 set_highlights(payload, fields) if options[:highlight]
506 506  
507 507 # timeout shortly after client times out
508   - payload[:timeout] ||=
509   - if Searchkick.search_timeout.is_a?(Integer)
510   - "#{Searchkick.search_timeout + 1}s"
511   - else
512   - "#{((Searchkick.search_timeout + 1) * 1000).round}ms"
513   - end
  508 + payload[:timeout] ||= "#{((Searchkick.search_timeout + 1) * 1000).round}ms"
514 509  
515 510 # An empty array will cause only the _id and _type for each hit to be returned
516 511 # https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-source-filtering.html
... ...