mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(commom): setStatus with notify hook (#19412)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
This commit is contained in:
@@ -131,7 +131,7 @@ func (sa *SScriptApply) StopApply(userCred mcclient.TokenCredential, record *SSc
|
||||
record.Fail(failCode, reason)
|
||||
}
|
||||
}
|
||||
sa.SetStatus(userCred, status, "")
|
||||
sa.SetStatus(context.Background(), userCred, status, "")
|
||||
ScriptApplyManager.Session.Remove(sa.Id)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ func (su *SServiceUrl) MarkCreateFailed(reason string) {
|
||||
}
|
||||
|
||||
func (su *SServiceUrl) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) {
|
||||
su.SetStatus(userCred, api.SERVICEURL_STATUS_CREATING, "")
|
||||
su.SetStatus(ctx, userCred, api.SERVICEURL_STATUS_CREATING, "")
|
||||
|
||||
task, err := taskman.TaskManager.NewTask(ctx, "ServiceUrlCreateTask", su, userCred, nil, "", "")
|
||||
if err != nil {
|
||||
|
||||
@@ -59,7 +59,7 @@ func init() {
|
||||
}
|
||||
|
||||
func (si *SSshInfo) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) {
|
||||
si.SetStatus(userCred, api.SSHINFO_STATUS_CREATING, "")
|
||||
si.SetStatus(ctx, userCred, api.SSHINFO_STATUS_CREATING, "")
|
||||
|
||||
task, err := taskman.TaskManager.NewTask(ctx, "SshInfoCreateTask", si, userCred, nil, "", "")
|
||||
if err != nil {
|
||||
@@ -77,7 +77,7 @@ func (si *SSshInfo) RealDelete(ctx context.Context, userCred mcclient.TokenCrede
|
||||
}
|
||||
|
||||
func (si *SSshInfo) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error {
|
||||
si.SetStatus(userCred, api.SSHINFO_STATUS_DELETING, "")
|
||||
si.SetStatus(ctx, userCred, api.SSHINFO_STATUS_DELETING, "")
|
||||
task, err := taskman.TaskManager.NewTask(ctx, "SshInfoDeleteTask", si, userCred, nil, "", "")
|
||||
if err != nil {
|
||||
log.Errorf("start SshInfoDeleteTask failed: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user