Skip to content

Commit

Permalink
Don't try to update if there is nothing to do
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpoole committed Jan 28, 2019
1 parent f098adc commit 1a5ce6f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/de/komoot/photon/elasticsearch/Updater.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ public void delete(Long id) {
}

private void updateDocuments() {
if (this.bulkRequest.numberOfActions() == 0) {
log.warn("Update empty");
return;
}
BulkResponse bulkResponse = bulkRequest.execute().actionGet();
if (bulkResponse.hasFailures()) {
log.error("error while bulk update: " + bulkResponse.buildFailureMessage());
Expand Down

0 comments on commit 1a5ce6f

Please sign in to comment.