forked from TrueCloudLab/rclone
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:
parent
c954c397d9
commit
c2bf300dd8
2 changed files with 6 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue