mirror of
https://github.com/hibiken/asynq.git
synced 2024-12-25 23:32:17 +08:00
Fix: Use buffered channel of size 1 to avoid goroutine leaks
This commit is contained in:
parent
989b2b6d55
commit
eb3216d354
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user