mirror of
https://github.com/sot-tech/mochi.git
synced 2026-06-20 03:14:21 -07:00
defer pprof.StopCPUProfile()
This commit is contained in:
@@ -43,6 +43,11 @@ func main() {
|
||||
|
||||
pprof.StartCPUProfile(f)
|
||||
log.V(1).Info("started profiling")
|
||||
|
||||
defer func() {
|
||||
pprof.StopCPUProfile()
|
||||
log.V(1).Info("stopped profiling")
|
||||
}()
|
||||
}
|
||||
|
||||
// Load the config file.
|
||||
@@ -65,11 +70,6 @@ func main() {
|
||||
<-interrupts
|
||||
log.V(1).Info("caught interrupt, shutting down...")
|
||||
|
||||
if profile {
|
||||
pprof.StopCPUProfile()
|
||||
log.V(1).Info("stopped profiling")
|
||||
}
|
||||
|
||||
err := s.Stop()
|
||||
if err != nil {
|
||||
log.Fatalf("failed to shutdown cleanly: %s", err)
|
||||
|
||||
Reference in New Issue
Block a user