mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(alerting): make sure xorm can reset execution_error
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user