Skip to content

Commit

Permalink
Removed unnecessary wrapper go routine.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-fox committed Mar 21, 2020
1 parent c18c435 commit 89fdcda
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions cmd/finley/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,20 +249,18 @@ func (o *doer) queue(fn func() error) {
go func() {
select {
case workerID := <-o.pool:
go func() {
err := fn()
if err != nil {
select {
case o.failed <- err:
default:
close(o.dead)
}
o.wg.Done()
return
err := fn()
if err != nil {
select {
case o.failed <- err:
default:
close(o.dead)
}
o.wg.Done()
o.pool <- workerID
}()
return
}
o.wg.Done()
o.pool <- workerID
case <-o.dead:
return
}
Expand Down

0 comments on commit 89fdcda

Please sign in to comment.