1
mirror of https://github.com/rclone/rclone synced 2024-11-28 06:41:41 +01:00

accounting: fix creating of global stats ignoring the config

Before this change the global stats were created before the global
config which meant they ignored the global config completely.
This commit is contained in:
Nick Craig-Wood 2024-07-11 12:32:19 +01:00
parent c954c397d9
commit c2bf300dd8
2 changed files with 6 additions and 3 deletions

View File

@ -39,6 +39,12 @@ func Start(ctx context.Context) {
// Start the transactions per second limiter
StartLimitTPS(ctx)
// Set the error count function pointer up in fs
//
// We can't do this in an init() method as it uses fs.Config
// and that isn't set up then.
fs.CountError = GlobalStats().Error
}
// Account limits and accounts for one transfer

View File

@ -17,9 +17,6 @@ var groups *statsGroups
func init() {
// Init stats container
groups = newStatsGroups()
// Set the function pointer up in fs
fs.CountError = GlobalStats().Error
}
func rcListStats(ctx context.Context, in rc.Params) (rc.Params, error) {