forked from TrueCloudLab/rclone
accounting: reset bytes read during copy retry - fixes #4178
During a copy/sync command, if an operation fails due to a network issue and is retried, the underlying io.Reader is re-initialised, but the stats for bytes already read are not reset, leading to incorrect stats. THis was fixed by resetting the bytes read when an Account is re-initialized.
This commit is contained in:
parent
54b16bd054
commit
10a6a92e52
1 changed files with 2 additions and 0 deletions
|
@ -138,6 +138,8 @@ func (acc *Account) UpdateReader(in io.ReadCloser) {
|
||||||
acc.close = in
|
acc.close = in
|
||||||
acc.origIn = in
|
acc.origIn = in
|
||||||
acc.closed = false
|
acc.closed = false
|
||||||
|
acc.lpBytes = 0
|
||||||
|
acc.bytes = int64(0)
|
||||||
if withBuf {
|
if withBuf {
|
||||||
acc.WithBuffer()
|
acc.WithBuffer()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue