Commit 172464e9 by Kyle Brandt Committed by GitHub

alerting: return err when SetAlertState fails to save to sql (#18216)

fix duplicate alert states when the alert fails to save to the database.
fixes #18176
parent 2014549f
......@@ -298,7 +298,10 @@ func SetAlertState(cmd *m.SetAlertStateCommand) error {
alert.ExecutionError = cmd.Error
}
sess.ID(alert.Id).Update(&alert)
_, err := sess.ID(alert.Id).Update(&alert)
if err != nil {
return err
}
cmd.Result = 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