| @@ -597,13 +597,23 @@ func (c *Cache) doUploading(pkgs []*uploadingPackage) { | |||||
| } | } | ||||
| oldPath := cdssdk.JoinObjectPath(o.pathComps[2:]...) | oldPath := cdssdk.JoinObjectPath(o.pathComps[2:]...) | ||||
| newPath := cdssdk.JoinObjectPath(o.cache.pathComps[2:]...) | |||||
| if o.isDeleted { | if o.isDeleted { | ||||
| uploader.CancelObject(oldPath) | uploader.CancelObject(oldPath) | ||||
| upCancel++ | upCancel++ | ||||
| continue | 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 { | if newPath != oldPath { | ||||
| uploader.RenameObject(oldPath, newPath) | uploader.RenameObject(oldPath, newPath) | ||||
| upRename++ | upRename++ | ||||