Commit 0defdd40286b02c0b7bf2afc6293d9abdffa18c6
1 parent
415b505c
Exists in
master
and in
19 other branches
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,6 +2,7 @@ | ||
2 | 2 | ||
3 | - Better exception when trying to access results for failed multi-search query | 3 | - Better exception when trying to access results for failed multi-search query |
4 | - More efficient aggregations with `where` clauses | 4 | - More efficient aggregations with `where` clauses |
5 | +- Try requests 3 times before raising error | ||
5 | - Added support for `faraday_middleware-aws-sigv4` | 6 | - Added support for `faraday_middleware-aws-sigv4` |
6 | - Added `credentials` option to `aws_credentials` | 7 | - Added `credentials` option to `aws_credentials` |
7 | - Added `modifier` option to `boost_by` | 8 | - Added `modifier` option to `boost_by` |
lib/searchkick.rb
@@ -55,7 +55,8 @@ module Searchkick | @@ -55,7 +55,8 @@ module Searchkick | ||
55 | 55 | ||
56 | Elasticsearch::Client.new({ | 56 | Elasticsearch::Client.new({ |
57 | url: ENV["ELASTICSEARCH_URL"], | 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 | }.deep_merge(client_options)) do |f| | 60 | }.deep_merge(client_options)) do |f| |
60 | f.use Searchkick::Middleware | 61 | f.use Searchkick::Middleware |
61 | f.request signer_middleware_key, signer_middleware_aws_params if aws_credentials | 62 | f.request signer_middleware_key, signer_middleware_aws_params if aws_credentials |