Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

accounting: fix startTime of statsGroups.sum

Haochen Tongd2050523de30
diff --git a/fs/accounting/stats_groups.go b/fs/accounting/stats_groups.go
index 7be1597a3..9c293e8b8 100644
--- a/fs/accounting/stats_groups.go
+++ b/fs/accounting/stats_groups.go
@@ -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
}