mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
fix(region): avoid not sync dns zone
This commit is contained in:
@@ -2748,7 +2748,7 @@ func (self *SCloudaccount) SyncAccountResources(ctx context.Context, userCred mc
|
||||
return errors.Wrapf(err, "GetProvider")
|
||||
}
|
||||
if cloudprovider.IsSupportProject(provider) {
|
||||
return func() error {
|
||||
err = func() error {
|
||||
lockman.LockRawObject(ctx, "projects", self.Id)
|
||||
defer lockman.ReleaseRawObject(ctx, "projects", self.Id)
|
||||
|
||||
@@ -2760,10 +2760,13 @@ func (self *SCloudaccount) SyncAccountResources(ctx context.Context, userCred mc
|
||||
log.Infof("Sync project for cloudaccount %s result: %s", self.Name, result.Result())
|
||||
return nil
|
||||
}()
|
||||
if err != nil {
|
||||
log.Errorf("sync project for account %s error: %v", self.Name, err)
|
||||
}
|
||||
}
|
||||
|
||||
if cloudprovider.IsSupportDnsZone(provider) {
|
||||
return func() error {
|
||||
err = func() error {
|
||||
lockman.LockRawObject(ctx, "dns_zones", self.Id)
|
||||
defer lockman.ReleaseRawObject(ctx, "dns_zones", self.Id)
|
||||
|
||||
@@ -2788,6 +2791,9 @@ func (self *SCloudaccount) SyncAccountResources(ctx context.Context, userCred mc
|
||||
}
|
||||
return nil
|
||||
}()
|
||||
if err != nil {
|
||||
log.Errorf("sync dns zone for account %s error: %v", self.Name, err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user