mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 15:17:25 +00:00
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)
|
||||
}
|
||||
pprof.StartCPUProfile(f)
|
||||
defer pprof.StopCPUProfile()
|
||||
}
|
||||
|
||||
for _, device := range cfg.Devices() {
|
||||
@ -728,6 +727,11 @@ func syncthingMain() {
|
||||
mainSvc.Stop()
|
||||
|
||||
l.Okln("Exiting")
|
||||
|
||||
if cpuProfile {
|
||||
pprof.StopCPUProfile()
|
||||
}
|
||||
|
||||
os.Exit(code)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user