forked from forgejo/forgejo
Backport #29532 Without `case <-t.C`, the workers would stop incorrectly, the test won't pass. For the worse case, there might be only one running worker processing the queue items for long time because other workers are stopped. The root cause is related to the logic of doDispatchBatchToWorker. It isn't a serious problem at the moment, so keep it as-is. (cherry picked from commit 86cd94cba6d63c84528f6f8d52b1ec22b44ac2f8)
This commit is contained in:
parent
1a65ecb867
commit
52f52f60f1
3 changed files with 42 additions and 9 deletions
|
@ -40,6 +40,8 @@ type WorkerPoolQueue[T any] struct {
|
|||
workerMaxNum int
|
||||
workerActiveNum int
|
||||
workerNumMu sync.Mutex
|
||||
|
||||
workerStartedCounter int32
|
||||
}
|
||||
|
||||
type flushType chan struct{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue