From 33f4c92378251103f41847df84903107f33ccb3c Mon Sep 17 00:00:00 2001 From: Yi Jin Date: Wed, 10 Apr 2024 13:37:56 -0700 Subject: [PATCH] address comments Signed-off-by: Yi Jin --- pkg/pool/worker_pool.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/pool/worker_pool.go b/pkg/pool/worker_pool.go index 891bfae29fc..b1e39bde781 100644 --- a/pkg/pool/worker_pool.go +++ b/pkg/pool/worker_pool.go @@ -43,11 +43,12 @@ func (p *workerPool) Init() { ctx, cancel := context.WithCancel(context.Background()) p.cancel = cancel - for i := 0; i < cap(p.workCh); i++ { + for i := 0; i < p.Size(); i++ { go func() { for { select { case <-ctx.Done(): + // TODO: exhaust workCh before exit return case work := <-p.workCh: work()