mirror of
https://github.com/rclone/rclone.git
synced 2025-08-14 07:49:00 +02:00
fs: fix goroutine leak and improve stats accounting process
This fixes the go routine leak in the stats accounting - don't start stats average loop when initializing `StatsInfo` - stop the loop instead of pausing - use a context instead of a channel - move `period` variable in `averageValues` struct Fixes #8570
This commit is contained in:
committed by
GitHub
parent
5173ca0454
commit
ddebca8d42
@ -298,6 +298,7 @@ func GlobalStats() *StatsInfo {
|
||||
// NewStatsGroup creates new stats under named group.
|
||||
func NewStatsGroup(ctx context.Context, group string) *StatsInfo {
|
||||
stats := NewStats(ctx)
|
||||
stats.startAverageLoop()
|
||||
stats.group = group
|
||||
groups.set(ctx, group, stats)
|
||||
return stats
|
||||
|
Reference in New Issue
Block a user