Skip to content

Commit

Permalink
NXP-30674: Use longer timeout for index operation
Browse files Browse the repository at this point in the history
  • Loading branch information
bdelbosc committed Nov 15, 2021
1 parent 3ccc5a2 commit 0054f4b
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -349,6 +349,10 @@ public GetResponse get(GetRequest request) {
@Override
public IndexResponse index(IndexRequest request) {
try {
if (IndexRequest.DEFAULT_TIMEOUT == request.timeout()) {
// use a longer timeout than the default one
request.timeout(LONG_TIMEOUT);
}
return client.index(request, RequestOptions.DEFAULT);
} catch (ElasticsearchStatusException e) {
if (RestStatus.CONFLICT.equals(e.status())) {
Expand Down

0 comments on commit 0054f4b

Please sign in to comment.