adds tests for journaling sql operations
This commit is contained in:
@@ -73,15 +73,16 @@ func (n *NotifierBase) ShouldNotify(c *alerting.EvalContext) bool {
|
||||
NotifierId: n.Id,
|
||||
}
|
||||
|
||||
if err := bus.DispatchCtx(c.Ctx, cmd); err != nil {
|
||||
err := bus.DispatchCtx(c.Ctx, cmd)
|
||||
if err != nil {
|
||||
n.log.Error("Could not determine last time alert notifier fired", "Alert name", c.Rule.Name, "Error", err)
|
||||
return false
|
||||
}
|
||||
|
||||
// this currently serves two purposes.
|
||||
// 1. make sure failed notifications try again
|
||||
// 2. make sure we send notifications if no previous exist
|
||||
// this should be refactored //Carl Bergquist
|
||||
if err == models.ErrJournalingNotFound {
|
||||
return true
|
||||
}
|
||||
|
||||
if !cmd.Result.Success {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user