fix(region): 避免删除云账号时遗留脏数据 (#17991)

This commit is contained in:
屈轩
2023-09-11 17:30:51 +08:00
committed by GitHub
parent 0a460bda28
commit 8582180c11
+2
View File
@@ -2217,6 +2217,8 @@ func (manager *SCloudaccountManager) AutoSyncCloudaccountStatusTask(ctx context.
}()
log.Debugf("syncAccountStatus %s %s", id, name)
ctx = context.WithValue(ctx, "id", id)
lockman.LockObject(ctx, account)
defer lockman.ReleaseObject(ctx, account)
err := account.syncAccountStatus(ctx, userCred)
if err != nil {
log.Errorf("unable to syncAccountStatus for cloudaccount %s: %s", account.Id, err.Error())