优化本地数据库性能

This commit is contained in:
刘祥超
2022-03-15 18:32:39 +08:00
parent ddebc0e4a8
commit 21e206061d
13 changed files with 940 additions and 515 deletions

View File

@@ -228,7 +228,7 @@ func (this *UpgradeManager) unzip(zipPath string) error {
func (this *UpgradeManager) restart() error {
// 重新启动
if DaemonIsOn && DaemonPid == os.Getppid() {
os.Exit(0) // TODO 试着更优雅重启
utils.Exit() // TODO 试着更优雅重启
} else {
exe, err := os.Executable()
if err != nil {
@@ -238,6 +238,9 @@ func (this *UpgradeManager) restart() error {
// quit
events.Notify(events.EventQuit)
// terminated
events.Notify(events.EventTerminated)
// 启动
cmd := exec.Command(exe, "start")
err = cmd.Start()