Skip to content

Commit

Permalink
fix hang on panic (fixes 99designs#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
neelance committed May 8, 2017
1 parent de3d54c commit b94674a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ func (r *Request) execSelections(ctx context.Context, sels []selected.Selection,
wg.Add(len(fields))
for _, f := range fields {
go func(f *fieldWithResolver) {
defer wg.Done()
defer r.handlePanic(ctx)
r.execFieldSelection(ctx, f.field, f.resolver, &f.out, false)
wg.Done()
}(f)
}
wg.Wait()
Expand Down Expand Up @@ -234,8 +234,8 @@ func (r *Request) execSelectionSet(ctx context.Context, sels []selected.Selectio
for i := 0; i < l; i++ {
go func(i int) {
defer r.handlePanic(ctx)
defer wg.Done()
r.execSelectionSet(ctx, sels, t.OfType, resolver.Index(i), &entryouts[i])
wg.Done()
}(i)
}
wg.Wait()
Expand Down

0 comments on commit b94674a

Please sign in to comment.