Skip to content

Commit

Permalink
when pprof not start,then painc
Browse files Browse the repository at this point in the history
Signed-off-by: awzhgw <[email protected]>
  • Loading branch information
awzhgw committed Jun 11, 2019
1 parent aee3516 commit 9d15d62
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ func main() {

if profPort != "" {
go func() {
http.ListenAndServe(fmt.Sprintf(":%v", profPort), nil)
err = http.ListenAndServe(fmt.Sprintf(":%v", profPort), nil)
if err != nil {
fmt.Println(fmt.Sprintf("cannot listen pprof %v err %v", profPort, err.Error()))
os.Exit(1)
}
}()
}

Expand Down

0 comments on commit 9d15d62

Please sign in to comment.