Skip to content

Commit

Permalink
fix: spawn worker when one die (#10)
Browse files Browse the repository at this point in the history
If a worker die, it doen"t update gCount so maybeStartG doesn"t start a
new one.
  • Loading branch information
guilhem authored Sep 19, 2021
1 parent 354d2f8 commit 2767a51
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions errgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ func (g *Group) startG() {
g.wg.Add(1)
go func() {
defer g.wg.Done()
defer atomic.AddInt64(&g.gCount, -1)

var f func() error

Expand Down

0 comments on commit 2767a51

Please sign in to comment.