Skip to content

Commit

Permalink
Prioritize worker pool shutdown (#3795)
Browse files Browse the repository at this point in the history
  • Loading branch information
yycptt authored Jan 10, 2023
1 parent ea893d1 commit bb4ec7f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/tasks/fifo_scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ func (f *FIFOScheduler[T]) processTask(
return
}

select {
case <-shutdownCh:
return
default:
}

select {
case task := <-f.tasksChan:
f.executeTask(task)
Expand Down

0 comments on commit bb4ec7f

Please # to comment.