before return make globalScannerMetrics.incTime call (#17230)

This commit is contained in:
jiuker 2023-05-19 04:45:05 +08:00 committed by GitHub
parent b06d7bf834
commit 7d433f16c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {