From d3ae3a8e146f0340776c4383458cebdc683bef7f Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 5 Jul 2016 10:23:14 -0700 Subject: [PATCH] collect proof when stopping --- weed/command/master.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weed/command/master.go b/weed/command/master.go index cb6b492e3..cd15defce 100644 --- a/weed/command/master.go +++ b/weed/command/master.go @@ -60,6 +60,9 @@ func runMaster(cmd *Command, args []string) bool { } pprof.StartCPUProfile(f) defer pprof.StopCPUProfile() + OnInterrupt(func() { + pprof.StopCPUProfile() + }) } if err := util.TestFolderWritable(*metaFolder); err != nil { glog.Fatalf("Check Meta Folder (-mdir) Writable %s : %s", *metaFolder, err)