Skip to content

Commit

Permalink
Fix race
Browse files Browse the repository at this point in the history
  • Loading branch information
crobert-1 committed Feb 5, 2024
1 parent f0e4a8e commit 8bc1cc1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion service/internal/proctelemetry/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ func InitPrometheusServer(registry *prometheus.Registry, address string, asyncEr
Addr: address,
Handler: mux,
}

serverWG.Add(1)
go func() {
serverWG.Add(1)
defer serverWG.Done()
if serveErr := server.ListenAndServe(); serveErr != nil && !errors.Is(serveErr, http.ErrServerClosed) {
asyncErrorChannel <- serveErr
Expand Down

0 comments on commit 8bc1cc1

Please sign in to comment.