diff --git a/cmd/data-scanner.go b/cmd/data-scanner.go index d403447f4..af116cbb9 100644 --- a/cmd/data-scanner.go +++ b/cmd/data-scanner.go @@ -1346,11 +1346,11 @@ func (d *dynamicSleeper) Timer(ctx context.Context) func() { select { case <-ctx.Done(): if !timer.Stop() { - if d.isScanner { - globalScannerMetrics.incTime(scannerMetricYield, wantSleep) - } <-timer.C } + if d.isScanner { + globalScannerMetrics.incTime(scannerMetricYield, wantSleep) + } return case <-timer.C: if d.isScanner {