operations: fix files moved by rclone move not being counted as transfers

Before this change we were only counting moves as checks. This means
that when using `rclone move` the `Transfers` stat did not count up
like it should do.

This changes introduces a new primitive operations.MoveTransfers which
counts moves as Transfers for use where that is appropriate, such as
rclone move/moveto. Otherwise moves are counted as checks and their
bytes are not accounted.

See: #7183
See: https://forum.rclone.org/t/stats-one-line-date-broken-in-1-64-0-and-later/43263/
This commit is contained in:
Nick Craig-Wood 2024-01-04 11:28:47 +00:00
parent d392f9fcd8
commit fbdf71ab64
2 changed files with 25 additions and 3 deletions

View file

@ -437,7 +437,7 @@ func (s *syncCopyMove) pairCopyOrMove(ctx context.Context, in *pipe, fdst fs.Fs,
dst := pair.Dst
if s.DoMove {
if src != dst {
_, err = operations.Move(ctx, fdst, dst, src.Remote(), src)
_, err = operations.MoveTransfer(ctx, fdst, dst, src.Remote(), src)
} else {
// src == dst signals delete the src
err = operations.DeleteFile(ctx, src)