Skip to content

Commit 5363459

Browse files
fix: race detection
1 parent e50d4f1 commit 5363459

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

proxy/proxy.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,15 @@ func (p *Server) Start() error {
6363

6464
p.logger.Info("Starting HTTP proxy with TLS termination", "port", p.httpPort)
6565

66+
p.pprofServer = &http.Server{
67+
Addr: ":6060", // pprof port
68+
Handler: http.DefaultServeMux,
69+
}
70+
6671
// Start pprof server on a different port
6772
go func() {
68-
p.pprofServer = &http.Server{
69-
Addr: ":6060", // pprof port
70-
Handler: http.DefaultServeMux,
71-
}
72-
7373
p.logger.Info("Starting pprof server", "port", 6060)
74+
7475
if err := p.pprofServer.ListenAndServe(); err != nil && errors.Is(err, http.ErrServerClosed) {
7576
p.logger.Error("pprof server error", "error", err)
7677
}

0 commit comments

Comments
 (0)