Skip to content

Commit

Permalink
fix: sending an individual email when having one grouped error
Browse files Browse the repository at this point in the history
  • Loading branch information
ranim-n committed Sep 27, 2024
1 parent acc5e71 commit c9ff997
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ private String composeMessageContent(final Map<String, Object> event, Boolean gr
.append("\tProcessor type: ").append(event.get("component_type")).append("\n")
.append("\tProcess group: ").append(event.get("process_group_name")).append("\n");

if (groupSimilarErrors) {
if (groupSimilarErrors && groupedEventsSize > 1) {
message.append("\tTotal similar errors : ").append(groupedEventsSize).append("\n");
}

Expand Down Expand Up @@ -417,7 +417,7 @@ public void sendErrorEmail(Map<String, Object> event, ReportingContext context,
emailSubjectBuilder.append("[").append(subjectPrefix).append("] ");
}

if (groupSimilarErrors) {
if (groupSimilarErrors && groupedEventsSize > 1) {
emailSubjectBuilder.append(groupedEventsSize).append(" errors occurred in processor ")
.append(event.get("component_name")).append(" in process group ")
.append(event.get("process_group_name"));
Expand Down

0 comments on commit c9ff997

Please sign in to comment.