Commit 0defdd40286b02c0b7bf2afc6293d9abdffa18c6

Authored by Andrew
1 parent 415b505c

Try requests 3 times before raising error

Showing 2 changed files with 3 additions and 1 deletions   Show diff stats
CHANGELOG.md
... ... @@ -2,6 +2,7 @@
2 2  
3 3 - Better exception when trying to access results for failed multi-search query
4 4 - More efficient aggregations with `where` clauses
  5 +- Try requests 3 times before raising error
5 6 - Added support for `faraday_middleware-aws-sigv4`
6 7 - Added `credentials` option to `aws_credentials`
7 8 - Added `modifier` option to `boost_by`
... ...
lib/searchkick.rb
... ... @@ -55,7 +55,8 @@ module Searchkick
55 55  
56 56 Elasticsearch::Client.new({
57 57 url: ENV["ELASTICSEARCH_URL"],
58   - transport_options: {request: {timeout: timeout}, headers: {content_type: "application/json"}}
  58 + transport_options: {request: {timeout: timeout}, headers: {content_type: "application/json"}},
  59 + retry_on_failure: 2
59 60 }.deep_merge(client_options)) do |f|
60 61 f.use Searchkick::Middleware
61 62 f.request signer_middleware_key, signer_middleware_aws_params if aws_credentials
... ...