mirror of
https://github.com/slackhq/nebula.git
synced 2026-08-15 09:57:00 +02:00
correctly shutdown the pprofserver
This commit is contained in:
@@ -37,7 +37,16 @@ func Main(c *config.C, configTest bool, buildVersion string, l *slog.Logger, dev
|
|||||||
}
|
}
|
||||||
|
|
||||||
//todo no merge
|
//todo no merge
|
||||||
go http.ListenAndServe(":6060", nil)
|
pprofServer := &http.Server{Addr: ":6060", Handler: nil}
|
||||||
|
go func() {
|
||||||
|
pprofServer.ListenAndServe()
|
||||||
|
}()
|
||||||
|
|
||||||
|
// Shut down the server when context is cancelled
|
||||||
|
go func() {
|
||||||
|
<-ctx.Done()
|
||||||
|
pprofServer.Shutdown(context.Background())
|
||||||
|
}()
|
||||||
|
|
||||||
// Print the config if in test, the exit comes later
|
// Print the config if in test, the exit comes later
|
||||||
if configTest {
|
if configTest {
|
||||||
|
|||||||
Reference in New Issue
Block a user