Skip to content

Commit

Permalink
Check if failedDeleteCount is positive before logging (opensearch-pro…
Browse files Browse the repository at this point in the history
…ject#3686)

Signed-off-by: Hai Yan <[email protected]>
  • Loading branch information
oeyh authored Nov 27, 2023
1 parent 039741a commit 6dc1d12
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ private void deleteSqsMessages(final List<DeleteMessageBatchRequestEntry> delete
final int failedDeleteCount = deleteMessageBatchResponse.failed().size();
sqsMessagesDeleteFailedCounter.increment(failedDeleteCount);

if(LOG.isErrorEnabled()) {
if(LOG.isErrorEnabled() && failedDeleteCount > 0) {
final String failedMessages = deleteMessageBatchResponse.failed().stream()
.map(failed -> failed.toString())
.collect(Collectors.joining(", "));
Expand Down

0 comments on commit 6dc1d12

Please sign in to comment.