Skip to content

Commit

Permalink
Check flag before profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
williamlsh committed Oct 9, 2021
1 parent fcbe461 commit e62b38c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ func run(args []string) error {
},
},
Before: func(c *cli.Context) error {
if !c.Bool("profile") {
return nil
}
go func() {
stdlog.Println("Starting pprof server at :6060")
stdlog.Fatal(http.ListenAndServe(":6060", http.DefaultServeMux))
Expand Down

0 comments on commit e62b38c

Please sign in to comment.