Merge pull request #18136 from ioito/hotfix/qx-ctx-unlock

fix(region): account ctx unlock
This commit is contained in:
Zexi Li
2023-09-22 16:49:46 +08:00
committed by GitHub
+4 -4
View File
@@ -2216,10 +2216,10 @@ func (manager *SCloudaccountManager) AutoSyncCloudaccountStatusTask(ctx context.
delete(cloudaccountProbe, id)
}()
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)
idctx := context.WithValue(ctx, "id", id)
lockman.LockObject(idctx, account)
defer lockman.ReleaseObject(idctx, account)
err := account.syncAccountStatus(idctx, userCred)
if err != nil {
log.Errorf("unable to syncAccountStatus for cloudaccount %s: %s", account.Id, err.Error())
}