mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #7036 from swordqiu/hotfix/qj-cloud-account-sync-sync
fix: cloud account sync may block
This commit is contained in:
@@ -2368,6 +2368,7 @@ func (account *SCloudaccount) SubmitSyncAccountTask(ctx context.Context, userCre
|
||||
if _, ok := cloudaccountPendingSyncs[account.Id]; ok {
|
||||
if waitChan != nil {
|
||||
// an active cloudaccount sync task is running, return with conflict error
|
||||
log.Errorf("an active cloudaccount sync task is running, early return with conflict error")
|
||||
waitChan <- errors.Wrap(httperrors.ErrConflict, "cloudaccountPendingSyncs")
|
||||
}
|
||||
return
|
||||
@@ -2386,8 +2387,9 @@ func (account *SCloudaccount) SubmitSyncAccountTask(ctx context.Context, userCre
|
||||
if waitChan != nil {
|
||||
if err != nil {
|
||||
account.markEndSync(userCred)
|
||||
err = errors.Wrap(err, "account.syncAccountStatus")
|
||||
}
|
||||
waitChan <- errors.Wrap(err, "account.syncAccountStatus")
|
||||
waitChan <- err
|
||||
} else {
|
||||
syncCnt := 0
|
||||
if err == nil && autoSync && account.GetEnabled() && account.EnableAutoSync {
|
||||
|
||||
Reference in New Issue
Block a user