Skip to content

Commit 4b5279a

Browse files
committed
Return if channel is closed
1 parent 0417bd5 commit 4b5279a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pool.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ func (p *pool) Start(maxWorkers int, fn interface{}) error {
4747
for {
4848
select {
4949
case args, ok := <-p.queue:
50-
if ok {
51-
h.Call(args)
50+
if !ok {
51+
return
5252
}
53+
54+
h.Call(args)
5355
case <-p.ctx.Done():
5456
return
5557
}

0 commit comments

Comments
 (0)