fix: Fix the problem of failed creation of child node snapshots (#8898)

Refs #8897
This commit is contained in:
ssongliu 2025-06-03 22:52:49 +08:00 committed by GitHub
parent a7ec06e066
commit 7bc2bbc1d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -268,11 +268,7 @@ func loadDbConn(snap *snapHelper, targetDir string, req dto.SnapshotCreate) erro
_ = taskDB.Where("id = ?", req.TaskID).Delete(&model.Task{}).Error
}
if !req.WithOperationLog {
err = snap.snapCoreDB.Exec("DELETE FROM operation_logs").Error
snap.Task.LogWithStatus(i18n.GetMsgByKey("SnapDeleteOperationLog"), err)
if err != nil {
return err
}
_ = snap.snapCoreDB.Exec("DELETE FROM operation_logs").Error
}
if !req.WithLoginLog {
err = snap.snapCoreDB.Exec("DELETE FROM login_logs").Error