Skip to content

Commit

Permalink
Fix panic introduced in #50
Browse files Browse the repository at this point in the history
Commit 8bc42b1 introduced a panic during
shutdown loop - `panic: sync: negative WaitGroup counter`.

Signed-off-by: Sergey Nuzhdin <[email protected]>
  • Loading branch information
lwolf committed Jun 30, 2020
1 parent 7e342c1 commit 1521444
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,15 @@ func main() {

wg.Add(1)
go func() {
defer wg.Done()
for {
<-stopCh
log.Println("shutting http server down")
err := server.Shutdown(ctx)
if err != nil {
log.Printf("failed to shutdown metrics server: %v\n", err)
}
wg.Done()
break
}
}()

Expand Down

0 comments on commit 1521444

Please sign in to comment.