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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user