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 11, 2024
1 parent 4f3e160 commit e21429d
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 e21429d

Please sign in to comment.