Revert changes post code review and move them to notification page

This commit is contained in:
John Baublitz
2018-06-04 13:19:14 +02:00
committed by bergquist
parent e068be4c26
commit 3cb0e27e1c
34 changed files with 215 additions and 107 deletions
+15
View File
@@ -143,3 +143,18 @@ func (c *EvalContext) GetNewState() m.AlertStateType {
return m.AlertStateOK
}
func (c *EvalContext) LastNotify(notifierId int64) *time.Time {
cmd := &m.GetLatestNotificationQuery{
OrgId: c.Rule.OrgId,
AlertId: c.Rule.Id,
NotifierId: notifierId,
}
if err := bus.Dispatch(cmd); err != nil {
c.log.Warn("Could not determine last time alert",
c.Rule.Name, "notified")
return nil
}
return &cmd.Result.SentAt
}