ソースを参照

Merge remote-tracking branch 'origin/dev' into dev

Vanessa 2 年 前
コミット
d69baac71d
3 ファイル変更9 行追加3 行削除
  1. 1 0
      app/electron/main.js
  2. 5 2
      kernel/model/process.go
  3. 3 1
      kernel/util/runtime.go

+ 1 - 0
app/electron/main.js

@@ -544,6 +544,7 @@ const initKernel = (initData) => {
       const initDatas = initData.split('-')
       const initDatas = initData.split('-')
       cmds.push('--workspace', initDatas[0])
       cmds.push('--workspace', initDatas[0])
       cmds.push('--lang', initDatas[1])
       cmds.push('--lang', initDatas[1])
+      cmds.push("--resident", "false")
       cmd = `ui version [${appVer}], booting kernel [${kernelPath} --wd=${appDir} --workspace=${initDatas[0]} --lang=${initDatas[1]}]`
       cmd = `ui version [${appVer}], booting kernel [${kernelPath} --wd=${appDir} --workspace=${initDatas[0]} --lang=${initDatas[1]}]`
     }
     }
     writeLog(cmd)
     writeLog(cmd)

+ 5 - 2
kernel/model/process.go

@@ -33,8 +33,11 @@ func HookResident() {
 
 
 	for range time.Tick(time.Second * 30) {
 	for range time.Tick(time.Second * 30) {
 		if 0 == util.CountSessions() {
 		if 0 == util.CountSessions() {
-			logging.LogInfof("no active session, exit kernel process now")
-			Close(false, 1)
+			time.Sleep(time.Second * 7)
+			if 0 == util.CountSessions() {
+				logging.LogInfof("no active session, exit kernel process now")
+				Close(false, 1)
+			}
 		}
 		}
 	}
 	}
 }
 }

+ 3 - 1
kernel/util/runtime.go

@@ -47,13 +47,15 @@ func logBootInfo() {
 	logging.LogInfof("kernel is booting:\n"+
 	logging.LogInfof("kernel is booting:\n"+
 		"    * ver [%s]\n"+
 		"    * ver [%s]\n"+
 		"    * arch [%s]\n"+
 		"    * arch [%s]\n"+
+		"    * resident [%v]\n"+
+		"    * pid [%d]\n"+
 		"    * runtime mode [%s]\n"+
 		"    * runtime mode [%s]\n"+
 		"    * working directory [%s]\n"+
 		"    * working directory [%s]\n"+
 		"    * read only [%v]\n"+
 		"    * read only [%v]\n"+
 		"    * container [%s]\n"+
 		"    * container [%s]\n"+
 		"    * database [ver=%s]\n"+
 		"    * database [ver=%s]\n"+
 		"    * workspace directory [%s, data %s]",
 		"    * workspace directory [%s, data %s]",
-		Ver, runtime.GOARCH, Mode, WorkingDir, ReadOnly, Container, DatabaseVer, WorkspaceDir, dataDirSize)
+		Ver, runtime.GOARCH, Resident, os.Getpid(), Mode, WorkingDir, ReadOnly, Container, DatabaseVer, WorkspaceDir, dataDirSize)
 }
 }
 
 
 func IsMutexLocked(m *sync.Mutex) bool {
 func IsMutexLocked(m *sync.Mutex) bool {