Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

桌面端内核进程不再以游离模式拉起 #6336

Closed
88250 opened this issue Oct 24, 2022 · 3 comments
Closed

桌面端内核进程不再以游离模式拉起 #6336

88250 opened this issue Oct 24, 2022 · 3 comments
Assignees
Labels
Milestone

Comments

@88250
Copy link
Member

88250 commented Oct 24, 2022

由 Electron 派生内核子进程时设置 detached 参数值为 false,并将纳入引用计数。

之前的版本就不再支持退出界面后内核驻留,所以内核无需游离,这样能更好地保证程序的完整性,同时也为后续支持内核随机端口多开做铺垫。主要改动点:

  • 传入内核参数 --resident=false
  • spawn 参数 detached: false
  • 移除 kernelProcess.unref()
@iamqiz
Copy link
Contributor

iamqiz commented Oct 28, 2022

D大 我现在运行pnpm run start 不会启动内核,导致运行失败
我是通过把下面这行改动为 if (isDevEnv) { 来解决的

siyuan/app/electron/main.js

Lines 547 to 553 in 8b3e3d2

if (!isDevEnv) {
const cp = require('child_process')
const kernelProcess = cp.spawn(kernelPath,
cmds, {
detached: false, // 桌面端内核进程不再以游离模式拉起 https://github.com/siyuan-note/siyuan/issues/6336
stdio: 'ignore',
},

这种方式会有问题吗? 有没有更好的方法?

@88250
Copy link
Member Author

88250 commented Oct 28, 2022

@iamqiz 开发环境需要手动先启动内核,加参数 --mode=dev

@iamqiz
Copy link
Contributor

iamqiz commented Nov 2, 2022

开发环境打开的gui不能通过X关闭按钮关闭, ???
没事了,内核升级到最新就行了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants