From ea4aa696a521ea7c2f8dabf2aa1fafbc70464a25 Mon Sep 17 00:00:00 2001 From: Jacob Hands Date: Wed, 16 Aug 2023 06:25:56 -0500 Subject: [PATCH] fs: Don't stop calculating average transfer speed until the operation is complete Currently, the average transfer speed will stop calculating 1 minute after the last queued transfer completes. This causes the average to stop calculating when checking is slow and the transfer queue becomes empty. This change will require all checks to complete before stopping the average speed calculation. --- fs/accounting/stats.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/accounting/stats.go b/fs/accounting/stats.go index 2d7376ab6..0faa74180 100644 --- a/fs/accounting/stats.go +++ b/fs/accounting/stats.go @@ -777,7 +777,7 @@ func (s *StatsInfo) DoneTransferring(remote string, ok bool) { s.transfers++ s.mu.Unlock() } - if s.transferring.empty() { + if s.transferring.empty() && s.checking.empty() { time.AfterFunc(averageStopAfter, s.stopAverageLoop) } }