mirror of https://github.com/minio/minio.git
fix: timeN function return final closure not be called (#21615)
VulnCheck / Analysis (push) Has been cancelled
Details
VulnCheck / Analysis (push) Has been cancelled
Details
This commit is contained in:
parent
b8631cf531
commit
534f4a9fb1
|
@ -106,10 +106,9 @@ func (p *scannerMetrics) log(s scannerMetric, paths ...string) func(custom map[s
|
|||
|
||||
// time n scanner actions.
|
||||
// Use for s < scannerMetricLastRealtime
|
||||
func (p *scannerMetrics) timeN(s scannerMetric) func(n int) func() {
|
||||
func (p *scannerMetrics) timeN(s scannerMetric) func(n int) {
|
||||
startTime := time.Now()
|
||||
return func(n int) func() {
|
||||
return func() {
|
||||
return func(n int) {
|
||||
duration := time.Since(startTime)
|
||||
|
||||
atomic.AddUint64(&p.operations[s], uint64(n))
|
||||
|
@ -117,7 +116,6 @@ func (p *scannerMetrics) timeN(s scannerMetric) func(n int) func() {
|
|||
p.latency[s].add(duration)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// time a scanner action.
|
||||
|
|
Loading…
Reference in New Issue