]> source.dussan.org Git - gitea.git/commit
Fix queue worker incorrectly stopped when there are still more items in the queue...
authorwxiaoguang <wxiaoguang@gmail.com>
Sat, 2 Mar 2024 16:07:54 +0000 (00:07 +0800)
committerGitHub <noreply@github.com>
Sat, 2 Mar 2024 16:07:54 +0000 (16:07 +0000)
commit6465f94a2d26cdacc232fddc20f98d98df61ddac
tree13ef5246ba51d6906cf9d902c22b05b8cd1e4a9b
parenta3f05d0d98408bb47333b19f505b21afcefa9e7c
Fix queue worker incorrectly stopped when there are still more items in the queue (#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.
modules/queue/workergroup.go
modules/queue/workerqueue.go
modules/queue/workerqueue_test.go