1
0
mirror of https://github.com/google/gops.git synced 2025-02-19 19:59:55 +02:00

handle error if CPU profile cannot start

This commit is contained in:
Jaana Burcu Dogan 2017-01-03 00:56:44 -08:00
parent 3f697a7e37
commit b95fa4807e

View File

@ -183,7 +183,7 @@ func handle(conn net.Conn, msg []byte) error {
pprof.Lookup("heap").WriteTo(conn, 0)
case signal.CPUProfile:
if err := pprof.StartCPUProfile(conn); err != nil {
return nil
return err
}
time.Sleep(30 * time.Second)
pprof.StopCPUProfile()