File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -84,12 +84,16 @@ func Serve() {
8484
8585 migrations .RunMigrations (ctx )
8686
87- if ! viper .GetBool ("production " ) {
87+ if viper .GetBool ("profiler " ) {
8888 go func () {
8989 debugServer := echo .New ()
9090 pprof .Register (debugServer )
9191 debugServer .Any ("/debug/fgprof" , echo .WrapHandler (fgprof .Handler ()))
92- debugServer .Logger .Fatal (debugServer .Start (":6060" ))
92+ debugServer .HideBanner = true
93+ debugServer .HidePort = true
94+ address := ":6060"
95+ log .Info ().Str ("address" , address ).Msg ("starting profiler" )
96+ debugServer .Logger .Fatal (debugServer .Start (address ))
9397 }()
9498 }
9599
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ func initializeDefaults() {
4646 viper .SetDefault ("port" , "5020" )
4747
4848 viper .SetDefault ("production" , true )
49+ viper .SetDefault ("profiler" , false )
4950
5051 viper .SetDefault ("database.redis.host" , "localhost" )
5152 viper .SetDefault ("database.redis.port" , 6379 )
You can’t perform that action at this time.
0 commit comments