Skip to content

Commit

Permalink
fix: call wg.Close() in defer func (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
or-shachar authored Nov 25, 2023
1 parent f8a97c7 commit cc47faa
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cacheproc/cacheproc.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func (p *Process) Run(ctx context.Context) error {
}
defer func() {
_ = p.close()
_ = wg.Wait()
}()
for {
var req wire.Request
Expand Down Expand Up @@ -102,11 +103,6 @@ func (p *Process) Run(ctx context.Context) error {
_ = bw.Flush()
return nil
})
select {
case <-ctx.Done():
return wg.Wait()
default:
}
}
}

Expand Down

0 comments on commit cc47faa

Please sign in to comment.