Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <[email protected]>
  • Loading branch information
lhy1024 committed Aug 8, 2024
1 parent 5ead31e commit 6bdb436
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions pkg/schedule/checker/checker_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package checker
import (
"bytes"
"context"
"sync"
"strconv"
"sync"
"time"

"github.com/pingcap/failpoint"
Expand Down Expand Up @@ -48,15 +48,14 @@ const (
MinPatrolRegionScanLimit = 128
MaxPatrolScanRegionLimit = 8192
patrolRegionPartition = 1024
patrolRegionChanLen = MaxPatrolScanRegionLimit
patrolRegionChanLen = MaxPatrolScanRegionLimit
)

var (
denyCheckersByLabelerCounter = labeler.LabelerEventCounter.WithLabelValues("checkers", "deny")
// WithLabelValues is a heavy operation, define variable to avoid call it every time.
pendingProcessedRegionsGauge = regionListGauge.WithLabelValues("pending_processed_regions")
priorityListGauge = regionListGauge.WithLabelValues("priority_list")
scanLimitGauge = regionListGauge.WithLabelValues("scan_limit")
)

// Controller is used to manage all checkers.
Expand Down Expand Up @@ -85,7 +84,7 @@ type Controller struct {
// interval is the config interval of patrol regions.
// It's used to update the ticker, so we need to
// record it to avoid updating the ticker frequently.
interval time.Duration
interval time.Duration
workerCount int
// patrolRegionScanLimit is the limit of regions to scan.
// It is calculated by the number of regions.
Expand Down
2 changes: 1 addition & 1 deletion server/cluster/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2921,7 +2921,7 @@ func TestPatrolRegionConcurrency(t *testing.T) {
for i := 0; i < 10; i++ {
suspectRegions = append(suspectRegions, uint64(i))
}
co.GetCheckerController().AddPendingProcessedRegions(suspectRegions...)
co.GetCheckerController().AddPendingProcessedRegions(false, suspectRegions...)
co.GetWaitGroup().Add(1)
co.PatrolRegions()
testutil.Eventually(re, func() bool {
Expand Down

0 comments on commit 6bdb436

Please sign in to comment.