Skip to content

Commit 8b3a442

Browse files
committed
using else-if instead of if, to avoid calling onFailure twice
1 parent 8126546 commit 8b3a442

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

x-pack/plugin/migrate/src/main/java/org/elasticsearch/xpack/migrate/action/ReindexDataStreamIndexTransportAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ void reindex(String sourceIndexName, String destIndexName, ActionListener<BulkBy
290290
)
291291
);
292292
}
293-
if (bulkByScrollResponse.getBulkFailures().isEmpty() == false) {
293+
else if (bulkByScrollResponse.getBulkFailures().isEmpty() == false) {
294294
BulkItemResponse.Failure firstBulkFailure = bulkByScrollResponse.getBulkFailures().get(0);
295295
listener.onFailure(
296296
new ElasticsearchException(

0 commit comments

Comments
 (0)