mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
fix: avoid account sync deadlock
This commit is contained in:
@@ -2380,9 +2380,11 @@ func (account *SCloudaccount) SubmitSyncAccountTask(ctx context.Context, userCre
|
||||
defer cloudaccountPendingSyncsMutex.Unlock()
|
||||
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")
|
||||
go func() {
|
||||
// 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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user