fix(region): skip record conflict error (#21900)

This commit is contained in:
屈轩
2024-12-26 09:46:55 +08:00
committed by GitHub
parent 2b29b9b6fb
commit 41b8579fc5
+5 -2
View File
@@ -16,6 +16,7 @@ package tasks
import (
"context"
"strings"
"yunion.io/x/jsonutils"
"yunion.io/x/log"
@@ -80,9 +81,11 @@ func (self *CloudAccountSyncInfoTask) OnInit(ctx context.Context, obj db.IStanda
func (self *CloudAccountSyncInfoTask) OnCloudaccountSyncReadyFailed(ctx context.Context, obj db.IStandaloneModel, err jsonutils.JSONObject) {
cloudaccount := obj.(*models.SCloudaccount)
db.OpsLog.LogEvent(cloudaccount, db.ACT_SYNC_HOST_FAILED, err, self.UserCred)
if !strings.Contains(err.String(), "ConflictError") {
db.OpsLog.LogEvent(cloudaccount, db.ACT_SYNC_HOST_FAILED, err, self.UserCred)
logclient.AddActionLogWithStartable(self, cloudaccount, logclient.ACT_CLOUD_SYNC, err, self.UserCred, false)
}
self.SetStageFailed(ctx, err)
logclient.AddActionLogWithStartable(self, cloudaccount, logclient.ACT_CLOUD_SYNC, err, self.UserCred, false)
}
func (self *CloudAccountSyncInfoTask) OnCloudaccountSyncReady(ctx context.Context, obj db.IStandaloneModel, body jsonutils.JSONObject) {