mirror of
https://github.com/hibiken/asynq.git
synced 2024-12-26 15:52:18 +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() {
|
go func() {
|
||||||
defer func() { <-p.sema /* release token */ }()
|
defer func() { <-p.sema /* release token */ }()
|
||||||
|
|
||||||
resCh := make(chan error)
|
resCh := make(chan error, 1)
|
||||||
task := &Task{Type: msg.Type, Payload: msg.Payload}
|
task := &Task{Type: msg.Type, Payload: msg.Payload}
|
||||||
go func() {
|
go func() {
|
||||||
resCh <- perform(p.handler, task)
|
resCh <- perform(p.handler, task)
|
||||||
|
Loading…
Reference in New Issue
Block a user