Close cpu profile file at exit

This commit is contained in:
Geoff Bourne 2019-05-04 14:22:51 -05:00
parent 19c9f1550d
commit b6edd937ea

View File

@ -48,6 +48,7 @@ func main() {
if err != nil {
logrus.WithError(err).Fatal("trying to create cpu profile file")
}
defer cpuProfileFile.Close()
logrus.WithField("file", *cpuProfileFile).Info("Starting cpu profiling")
err = pprof.StartCPUProfile(cpuProfileFile)