tech(alerting): set prev state when creating eval context

This commit is contained in:
bergquist
2016-11-07 13:01:54 +01:00
parent 489f087fbd
commit d7f11c304c
2 changed files with 7 additions and 8 deletions

View File

@@ -39,6 +39,7 @@ func NewEvalContext(alertCtx context.Context, rule *Rule) *EvalContext {
Logs: make([]*ResultLogEntry, 0),
EvalMatches: make([]*EvalMatch, 0),
log: log.New("alerting.evalContext"),
PrevAlertState: rule.State,
}
}

View File

@@ -59,8 +59,6 @@ func (handler *DefaultResultHandler) GetStateFromEvaluation(evalContext *EvalCon
}
func (handler *DefaultResultHandler) Handle(evalContext *EvalContext) error {
evalContext.PrevAlertState = evalContext.Rule.State
executionError := ""
annotationData := simplejson.New()