feat(alerting): recover from panic

This commit is contained in:
bergquist 2016-10-21 14:46:55 +02:00
parent 96008c9738
commit 2c7dbde06a

View File

@ -106,6 +106,13 @@ func (e *Engine) processJob(grafanaCtx context.Context, job *Job) error {
done := make(chan struct{})
go func() {
defer func() {
if err := recover(); err != nil {
e.log.Error("Alert Panic", "error", err, "stack", log.Stack(1))
close(done)
}
}()
e.evalHandler.Eval(evalContext)
e.resultHandler.Handle(evalContext)
close(done)