mirror of
https://github.com/rclone/rclone.git
synced 2026-01-06 18:43:50 +00:00
accounting: add RemoveDoneTransfers method to fix bisync race #8815
Before this change bisync was adjusting MaxCompletedTransfers in order to clear the done transfers from the stats. This wasn't working (because it was only clearing one transfer) and was part of a race adjusting MaxCompletedTransfers. This fixes the problem by introducing a new method RemoveDoneTransfers to clear the done transfers explicitly and calling it in bisync.
This commit is contained in:
@@ -707,8 +707,7 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, res
|
||||
prettyprint(dstList.list, "dstList", fs.LogLevelDebug)
|
||||
|
||||
// clear stats so we only do this once
|
||||
accounting.MaxCompletedTransfers = 0
|
||||
accounting.Stats(ctx).PruneTransfers()
|
||||
accounting.Stats(ctx).RemoveDoneTransfers()
|
||||
}
|
||||
|
||||
if b.DebugName != "" {
|
||||
|
||||
Reference in New Issue
Block a user