Fix schedule error msg.

Signed-off-by: fanjiankong <fanjiankong@tencent.com>
This commit is contained in:
fanjiankong 2020-08-25 23:41:15 +08:00
parent 4a7a54cae8
commit bbad4db645

View File

@ -377,7 +377,12 @@ func (c *controller) UpdatePolicy(ctx context.Context, schema *policyModels.Sche
// Update timestamp
schema.UpdatedTime = time.Now()
return c.pManager.Update(ctx, schema, props...)
err = c.pManager.Update(ctx, schema, props...)
if (err != nil) && (needSch || needUn) {
return errors.Wrapf(err, "Update failed, but not rollback scheduler")
}
return err
}
// DeletePolicy deletes the policy by id.