Commit d3421c67 by bergquist

fix(alerting): make sure xorm can reset execution_error

parent def4632f
......@@ -222,7 +222,11 @@ func SetAlertState(cmd *m.SetAlertStateCommand) error {
alert.State = cmd.State
alert.StateChanges += 1
alert.NewStateDate = time.Now()
alert.ExecutionError = cmd.Error
if cmd.Error == "" {
alert.ExecutionError = " " //without this space, xorm skips updating this field
} else {
alert.ExecutionError = cmd.Error
}
sess.Id(alert.Id).Update(&alert)
return nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment