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.
This commit is contained in:
Jacob Hands 2023-08-16 06:25:56 -05:00 committed by Nick Craig-Wood
parent 34195fd3e8
commit ea4aa696a5

View File

@ -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)
}
}