From eb240e449f16a46669adad592404f0694c50334e Mon Sep 17 00:00:00 2001 From: Sydonian <794346190@qq.com> Date: Mon, 31 Mar 2025 17:37:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=8A=E4=BC=A0=E5=90=8E?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E4=B8=8A=E4=BC=A0=E5=AF=B9=E8=B1=A1=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E9=87=8D=E5=91=BD=E5=90=8D=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client2/internal/mount/vfs/cache/cache.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/client2/internal/mount/vfs/cache/cache.go b/client2/internal/mount/vfs/cache/cache.go index 0434d7a..ee4ba3e 100644 --- a/client2/internal/mount/vfs/cache/cache.go +++ b/client2/internal/mount/vfs/cache/cache.go @@ -597,13 +597,23 @@ func (c *Cache) doUploading(pkgs []*uploadingPackage) { } oldPath := cdssdk.JoinObjectPath(o.pathComps[2:]...) + newPath := cdssdk.JoinObjectPath(o.cache.pathComps[2:]...) + if o.isDeleted { uploader.CancelObject(oldPath) upCancel++ continue } - newPath := cdssdk.JoinObjectPath(o.cache.pathComps[2:]...) + // 如果对象移动到了另一个Package,那么也要取消上传 + if !lo2.ArrayEquals(o.pathComps[:2], o.cache.pathComps[:2]) { + uploader.CancelObject(oldPath) + upCancel++ + continue + + } + + // 只有仍在同Package内移动的对象才能直接重命名 if newPath != oldPath { uploader.RenameObject(oldPath, newPath) upRename++