]> source.dussan.org Git - gitea.git/commit
Fix queue worker incorrectly stopped when there are still more items in the queue...
authorGiteabot <teabot@gitea.io>
Sat, 2 Mar 2024 19:40:06 +0000 (03:40 +0800)
committerGitHub <noreply@github.com>
Sat, 2 Mar 2024 19:40:06 +0000 (19:40 +0000)
commit86cd94cba6d63c84528f6f8d52b1ec22b44ac2f8
tree94545862329e83bffd660a64562d0af9e8c78688
parent8723389028bcb5e96359fca61efd7d6da0d6af99
Fix queue worker incorrectly stopped when there are still more items in the queue (#29532) (#29546)

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.
modules/queue/workergroup.go
modules/queue/workerqueue.go
modules/queue/workerqueue_test.go