Skip to content

Commit 0edac05

Browse files
authored
Merge pull request #23 from synadia-io/fix-waitgroup-race
[fix] AsyncWorker could have a race if Stop() was called before the AsyncWorker finished registration
2 parents 54a7a52 + 5225e67 commit 0edac05

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

authservice.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ func NewAuthorizationService(
205205
if options.AsyncWorkers > 0 {
206206
callout.workersCh = make(chan micro.Request, 5000)
207207
for i := 0; i < options.AsyncWorkers; i++ {
208+
callout.wg.Add(1)
208209
go func() {
209-
callout.wg.Add(1)
210210
defer callout.wg.Done()
211211
for {
212212
select {

0 commit comments

Comments
 (0)