feat(alerting): skeleton commit for webhook

This commit is contained in:
bergquist
2016-06-16 08:16:16 +02:00
parent a3b7ea7704
commit efea3bc9cb
5 changed files with 107 additions and 4 deletions
+2 -1
View File
@@ -134,6 +134,7 @@ func (e *Engine) saveState(result *AlertResult) {
query := &m.GetAlertByIdQuery{Id: result.AlertJob.Rule.Id}
bus.Dispatch(query)
e.notifier.Notify(result)
if query.Result.ShouldUpdateState(result.State) {
cmd := &m.UpdateAlertStateCommand{
AlertId: result.AlertJob.Rule.Id,
@@ -146,7 +147,7 @@ func (e *Engine) saveState(result *AlertResult) {
}
e.log.Debug("will notify! about", "new state", result.State)
e.notifier.Notify(result)
} else {
e.log.Debug("state remains the same!")
}