From da955e5d4f444cf1b335755229c9bf024bd95a4f Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 21 Jun 2023 19:35:17 +0100 Subject: [PATCH] operations: remove partials when the copy fails Before this change we were only removing partials when it was corrupted rather than when the copy just failed. --- fs/operations/operations.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/operations/operations.go b/fs/operations/operations.go index 4308df7fa..8c20fbe40 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -529,6 +529,9 @@ func Copy(ctx context.Context, f fs.Fs, dst fs.Object, remote string, src fs.Obj if err != nil { err = fs.CountError(err) fs.Errorf(src, "Failed to copy: %v", err) + if !inplace { + removeFailedPartialCopy(ctx, f, remotePartial) + } return newDst, err }