Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <[email protected]>
  • Loading branch information
lhy1024 committed Apr 18, 2024
1 parent 44966d9 commit 08e9e37
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions pkg/schedule/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,6 @@ func (c *Coordinator) PatrolRegions() {
quit = make(chan bool)
c.startPatrolRegionWorkers(workers, regionChan, quit, &wg)
}
case <-c.ctx.Done():
patrolCheckRegionsGauge.Set(0)
c.setPatrolRegionsDuration(0)
log.Info("patrol regions has been stopped")
close(regionChan)
close(quit)
wg.Wait()
return
default:
if c.isSchedulingHalted() {
for len(regionChan) > 0 {
<-regionChan
Expand Down Expand Up @@ -229,6 +220,14 @@ func (c *Coordinator) PatrolRegions() {
failpoint.Inject("break-patrol", func() {
failpoint.Break()
})
case <-c.ctx.Done():
patrolCheckRegionsGauge.Set(0)
c.setPatrolRegionsDuration(0)
log.Info("patrol regions has been stopped")
close(regionChan)
close(quit)
wg.Wait()
return
}
}
}
Expand Down

0 comments on commit 08e9e37

Please sign in to comment.