Stop cpu profiling at the execution of lcimport
@@ -22,6 +22,7 @@ import (
"encoding/json"
"fmt"
"os"
+ "runtime/pprof"
"strconv"
"strings"
"text/scanner"
@@ -646,6 +647,10 @@ func main() {
return nil
}
+ root.PersistentPostRun = func(cmd *cobra.Command, args []string) {
+ pprof.StopCPUProfile()
+ }
+
if err := root.Execute(); err != nil {
log.Errorf("Fail to execute err=%+v", err)
os.Exit(1)
