Skip to content

Commit

Permalink
fix: executor run block when executor.stop() (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfyiamcool authored May 8, 2023
1 parent 2936a47 commit 2156260
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,16 @@ func (e *executor) run() {
switch e.limitMode {
case RescheduleMode:
if e.limitModeRunningJobs.Load() < int64(e.limitModeMaxRunningJobs) {
e.limitModeQueue <- f
select {
case e.limitModeQueue <- f:
case <-e.ctx.Done():
}
}
case WaitMode:
e.limitModeQueue <- f
select {
case e.limitModeQueue <- f:
case <-e.ctx.Done():
}
}
return
}
Expand Down

0 comments on commit 2156260

Please sign in to comment.