Make sure CPU profile actually gets written before exiting
This commit is contained in:
parent
491452a19d
commit
d3387e2a28
@ -672,7 +672,6 @@ func syncthingMain() {
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
pprof.StartCPUProfile(f)
|
pprof.StartCPUProfile(f)
|
||||||
defer pprof.StopCPUProfile()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, device := range cfg.Devices() {
|
for _, device := range cfg.Devices() {
|
||||||
@ -728,6 +727,11 @@ func syncthingMain() {
|
|||||||
mainSvc.Stop()
|
mainSvc.Stop()
|
||||||
|
|
||||||
l.Okln("Exiting")
|
l.Okln("Exiting")
|
||||||
|
|
||||||
|
if cpuProfile {
|
||||||
|
pprof.StopCPUProfile()
|
||||||
|
}
|
||||||
|
|
||||||
os.Exit(code)
|
os.Exit(code)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user