From 3e813a23d8924a8c347de6b39c5a04a6426da84e Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Wed, 31 Jul 2024 13:26:41 +0200 Subject: [PATCH] Incident: Log ignored superfluous events --- internal/incident/incident.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/incident/incident.go b/internal/incident/incident.go index ef6dbfcd..4ede9396 100644 --- a/internal/incident/incident.go +++ b/internal/incident/incident.go @@ -265,8 +265,8 @@ func (i *Incident) processSeverityChangedEvent(ctx context.Context, tx *sqlx.Tx, oldSeverity := i.Severity newSeverity := ev.Severity if oldSeverity == newSeverity { - err := fmt.Errorf("%w: %s state event from source %d", event.ErrSuperfluousStateChange, ev.Severity.String(), ev.SourceId) - return err + i.Logger.Debugw("Ignoring superfluous severity change event", zap.Int64("source_id", ev.SourceId), zap.Stringer("event", ev)) + return event.ErrSuperfluousStateChange } i.Logger.Infof("Incident severity changed from %s to %s", oldSeverity.String(), newSeverity.String())