fix: close cpu profile

Signed-off-by: guoguangwu <guoguangwug@gmail.com>
This commit is contained in:
guangwu 2024-04-07 15:05:45 +08:00 committed by Nick Craig-Wood
parent 8817ee25ae
commit 2ab2ec29f9

View File

@ -444,6 +444,11 @@ func initConfig() {
}
atexit.Register(func() {
pprof.StopCPUProfile()
err := f.Close()
if err != nil {
err = fs.CountError(err)
log.Fatal(err)
}
})
}