diff --git a/fs/operations/operations.go b/fs/operations/operations.go index bc5832b59..dcf296b90 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -405,7 +405,7 @@ func Copy(ctx context.Context, f fs.Fs, dst fs.Object, remote string, src fs.Obj if err == nil { dst = newDst in.ServerSideCopyEnd(dst.Size()) // account the bytes for the server-side transfer - err = in.Close() + _ = in.Close() } else { _ = in.Close() } @@ -598,6 +598,8 @@ func Move(ctx context.Context, fdst fs.Fs, dst fs.Object, remote string, src fs. } } // Move dst <- src + in := tr.Account(ctx, nil) // account the transfer + in.ServerSideCopyStart() newDst, err = doMove(ctx, src, remote) switch err { case nil: @@ -606,13 +608,16 @@ func Move(ctx context.Context, fdst fs.Fs, dst fs.Object, remote string, src fs. } else { fs.Infof(src, "Moved (server-side)") } - + in.ServerSideCopyEnd(newDst.Size()) // account the bytes for the server-side transfer + _ = in.Close() return newDst, nil case fs.ErrorCantMove: fs.Debugf(src, "Can't move, switching to copy") + _ = in.Close() default: err = fs.CountError(err) fs.Errorf(src, "Couldn't move: %v", err) + _ = in.Close() return newDst, err } }