Skip to content

Commit

Permalink
Check if failedDeleteCount is positive before logging (#3686) (#3705)
Browse files Browse the repository at this point in the history
Signed-off-by: Hai Yan <[email protected]>
(cherry picked from commit 6dc1d12)

Co-authored-by: Hai Yan <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and oeyh authored Nov 27, 2023
1 parent 250e1a0 commit b1f7aa8
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 b1f7aa8

Please sign in to comment.