Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d24d02e

Browse files
committed
pprof 经常退出,看看什么原因
1 parent 4fde274 commit d24d02e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/studygolang/pprof.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
package main
88

99
import (
10+
"fmt"
1011
"net/http"
1112
"net/http/pprof"
1213
)
@@ -20,7 +21,7 @@ func Pprof(addr string) {
2021
ps.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
2122
go func() {
2223
if err := http.ListenAndServe(addr, ps); err != nil {
23-
panic(err)
24+
fmt.Println("pprof exit:", err)
2425
}
2526
}()
2627
}

0 commit comments

Comments
 (0)