Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Yi Jin <[email protected]>
  • Loading branch information
jnyi committed Apr 10, 2024
1 parent 88a67ee commit 33f4c92
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/pool/worker_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 33f4c92

Please sign in to comment.