File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -44,11 +44,6 @@ var Exit = os.Exit
4444
4545func main () {
4646
47- // Uncomment the following lines to enable the pprof HTTP server for debugging
48- // go func() {
49- // panic(http.ListenAndServe(":6060", nil))
50- // }()
51-
5247 exitCode .Store (cmdopts .ExitCodeOK )
5348 defer func () {
5449 if err := recover (); err != nil {
Original file line number Diff line number Diff line change 1+ //go:build pprof
2+
3+ package main
4+
5+ import (
6+ "net/http"
7+
8+ _ "net/http/pprof" // Import for pprof HTTP server
9+ )
10+
11+ func init () {
12+ // Start pprof HTTP server for debugging when build tag 'pprof' is enabled
13+ go func () {
14+ // Using panic here will cause the application to exit if pprof server fails to start
15+ // This is intentional behavior for debugging builds
16+ panic (http .ListenAndServe (":6060" , nil ))
17+ }()
18+ }
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ services:
1414 ports :
1515 - " 8080:8080"
1616 - " 9187:9187"
17+ # - "6060:6060" # Uncomment for profiling
1718 depends_on :
1819 postgres :
1920 condition : service_healthy
You can’t perform that action at this time.
0 commit comments