forked from TrueCloudLab/rclone
accounting: fix race detected by the race detector
This commit is contained in:
parent
d08b49d723
commit
10270a4354
1 changed files with 2 additions and 0 deletions
|
@ -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 a new issue