Add an exit point in case all alerts are filtered
This commit is contained in:
parent
6a0b4cc8b2
commit
f5cfe0b4e8
|
@ -128,6 +128,12 @@ func (n *DedupingNotifier) Notify(ctx context.Context, alerts ...*types.Alert) e
|
|||
})
|
||||
}
|
||||
|
||||
// The deduping notifier is the last one before actually sending notifications.
|
||||
// Thus, this is the place where we abort if after all filtering, nothing is left.
|
||||
if len(filtered) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := n.notifier.Notify(ctx, filtered...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue