1
mirror of https://github.com/rclone/rclone synced 2024-11-17 17:30:37 +01:00

accounting: fix startTime of statsGroups.sum

This commit is contained in:
Haochen Tong 2021-06-14 00:32:44 +08:00 committed by Nick Craig-Wood
parent 1cc6dd349e
commit d2050523de

View File

@ -2,9 +2,8 @@ package accounting
import (
"context"
"sync"
"github.com/rclone/rclone/fs/rc"
"sync"
"github.com/rclone/rclone/fs"
)
@ -349,6 +348,7 @@ func (sg *statsGroups) names() []string {
// sum returns aggregate stats that contains summation of all groups.
func (sg *statsGroups) sum(ctx context.Context) *StatsInfo {
startTime := GlobalStats().startTime
sg.mu.Lock()
defer sg.mu.Unlock()
@ -377,6 +377,7 @@ func (sg *statsGroups) sum(ctx context.Context) *StatsInfo {
}
stats.mu.RUnlock()
}
sum.startTime = startTime
return sum
}