mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
fix: cloud-account sync ignore db failure
This commit is contained in:
@@ -520,6 +520,9 @@ func (self *SCloudaccount) importSubAccount(ctx context.Context, userCred mcclie
|
||||
isNew := false
|
||||
q := CloudproviderManager.Query().Equals("cloudaccount_id", self.Id).Equals("account", subAccount.Account)
|
||||
providerCount := q.Count()
|
||||
if providerCount < 0 {
|
||||
return nil, false, fmt.Errorf("fail to query subaccount")
|
||||
}
|
||||
if providerCount > 1 {
|
||||
log.Errorf("cloudaccount %s has duplicate subaccount with name %s", self.Name, subAccount.Account)
|
||||
return nil, isNew, cloudprovider.ErrDuplicateId
|
||||
|
||||
Reference in New Issue
Block a user