Skip to content

Commit

Permalink
fixing ResultsPersisterService
Browse files Browse the repository at this point in the history
  • Loading branch information
masseyke committed Dec 7, 2023
1 parent 5a9f08f commit 1e0bc1b
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -147,11 +147,12 @@ public BulkResponse indexWithRetry(
Supplier<Boolean> shouldRetry,
Consumer<String> retryMsgHandler
) throws IOException {
BulkRequest bulkRequest = new BulkRequest().setRefreshPolicy(refreshPolicy);
try (XContentBuilder content = object.toXContent(XContentFactory.jsonBuilder(), params)) {
bulkRequest.add(new IndexRequest(indexName).id(id).source(content).setRequireAlias(requireAlias));
try (BulkRequest bulkRequest = new BulkRequest().setRefreshPolicy(refreshPolicy)) {
try (XContentBuilder content = object.toXContent(XContentFactory.jsonBuilder(), params)) {
bulkRequest.add(new IndexRequest(indexName).id(id).source(content).setRequireAlias(requireAlias));
}
return bulkIndexWithRetry(bulkRequest, jobId, shouldRetry, retryMsgHandler);
}
return bulkIndexWithRetry(bulkRequest, jobId, shouldRetry, retryMsgHandler);
}

public void indexWithRetry(

0 comments on commit 1e0bc1b

Please sign in to comment.