adds tests for journaling sql operations

This commit is contained in:
bergquist
2018-06-16 11:27:04 +02:00
parent c21938d4c4
commit 83a12afc07
4 changed files with 60 additions and 8 deletions
+6 -5
View File
@@ -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
}