1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-21 08:31:27 -05:00

workergroup: gracefully exit on close(popItemErr)

This commit is contained in:
oliverpool 2024-03-19 16:24:28 +01:00
parent fb6bcf1029
commit 639ac7a131

View file

@ -334,7 +334,10 @@ func (q *WorkerPoolQueue[T]) doRun() {
// since we are already in a "flush" operation, so the dispatching function shouldn't read the flush chan. // since we are already in a "flush" operation, so the dispatching function shouldn't read the flush chan.
q.doDispatchBatchToWorker(wg, skipFlushChan) q.doDispatchBatchToWorker(wg, skipFlushChan)
q.doFlush(wg, flush) q.doFlush(wg, flush)
case err := <-wg.popItemErr: case err, errOk := <-wg.popItemErr:
if !errOk {
return
}
if !q.isCtxRunCanceled() { if !q.isCtxRunCanceled() {
log.Error("Failed to pop item from queue %q (doRun): %v", q.GetName(), err) log.Error("Failed to pop item from queue %q (doRun): %v", q.GetName(), err)
} }