mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 09:04:52 +01:00
accounting: fix race detected by the race detector
This commit is contained in:
parent
d08b49d723
commit
10270a4354
@ -313,7 +313,9 @@ func (s *StatsInfo) calculateTransferStats() (ts transferStats) {
|
||||
// note that s.bytes already includes transferringBytesDone so
|
||||
// we take it off here to avoid double counting
|
||||
ts.totalBytes = s.transferQueueSize + s.bytes + transferringBytesTotal - transferringBytesDone
|
||||
s.average.mu.Lock()
|
||||
ts.speed = s.average.speed
|
||||
s.average.mu.Unlock()
|
||||
dt := s._totalDuration()
|
||||
ts.transferTime = dt.Seconds()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user