mirror of
https://github.com/LBRYFoundation/tracker.git
synced 2025-08-28 07:51:28 +00:00
defer pprof.StopCPUProfile()
This commit is contained in:
parent
caba155b5d
commit
e0ead67737
1 changed files with 5 additions and 5 deletions
10
main.go
10
main.go
|
@ -43,6 +43,11 @@ func main() {
|
||||||
|
|
||||||
pprof.StartCPUProfile(f)
|
pprof.StartCPUProfile(f)
|
||||||
log.V(1).Info("started profiling")
|
log.V(1).Info("started profiling")
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
pprof.StopCPUProfile()
|
||||||
|
log.V(1).Info("stopped profiling")
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the config file.
|
// Load the config file.
|
||||||
|
@ -65,11 +70,6 @@ func main() {
|
||||||
<-interrupts
|
<-interrupts
|
||||||
log.V(1).Info("caught interrupt, shutting down...")
|
log.V(1).Info("caught interrupt, shutting down...")
|
||||||
|
|
||||||
if profile {
|
|
||||||
pprof.StopCPUProfile()
|
|
||||||
log.V(1).Info("stopped profiling")
|
|
||||||
}
|
|
||||||
|
|
||||||
err := s.Stop()
|
err := s.Stop()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("failed to shutdown cleanly: %s", err)
|
log.Fatalf("failed to shutdown cleanly: %s", err)
|
||||||
|
|
Loading…
Add table
Reference in a new issue