Add an exit point in case all alerts are filtered

This commit is contained in:
Fabian Reinartz 2015-09-30 18:44:33 +02:00
parent 6a0b4cc8b2
commit f5cfe0b4e8
1 changed files with 6 additions and 0 deletions

View File

@ -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
}