accounting: fix global error acounting
fs.CountError is called when an error is encountered. The method was calling GlobalStats().Error(err) which incremented the error at the global stats level. This led to calls to core/stats with group= filter returning an error count of 0 even if errors actually occured. This change requires the context to be provided when calling fs.CountError. Doing so, we can retrieve the correct StatsInfo to increment the errors from. Fixes #5865
This commit is contained in:
committed by
Nick Craig-Wood
parent
c053429b9c
commit
8a6fc8535d
@@ -44,7 +44,9 @@ func Start(ctx context.Context) {
|
||||
//
|
||||
// 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
|
||||
fs.CountError = func(ctx context.Context, err error) error {
|
||||
return Stats(ctx).Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Account limits and accounts for one transfer
|
||||
|
||||
Reference in New Issue
Block a user