2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-09-20 11:05:58 +08:00

Fix: Use buffered channel of size 1 to avoid goroutine leaks

This commit is contained in:
Ken Hibino 2019-12-16 06:40:52 -08:00
parent 989b2b6d55
commit eb3216d354

View File

@ -94,7 +94,7 @@ func (p *processor) exec() {
go func() {
defer func() { <-p.sema /* release token */ }()
resCh := make(chan error)
resCh := make(chan error, 1)
task := &Task{Type: msg.Type, Payload: msg.Payload}
go func() {
resCh <- perform(p.handler, task)