change sqlite backend; upgrade electron; fix ipc file cannot listen in macOS

This commit is contained in:
geekgeekrun
2026-01-21 02:56:42 +08:00
parent c23d590052
commit afe8a820c1
7 changed files with 494 additions and 587 deletions
@@ -19,13 +19,8 @@ export async function connectToDaemon() {
await new Promise((resolve, reject) => {
const ipcSocketName = process.env.GEEKGEEKRUND_PIPE_NAME
const ipcSocketPath = process.platform === 'win32'
? `\\\\.\\pipe\\${ipcSocketName}`
: path.join(tmpdir(), `${ipcSocketName}.sock`)
if (process.platform === 'darwin' && !fs.existsSync(ipcSocketPath)) {
fs.writeFileSync(ipcSocketPath, '')
// 设置权限(Unix
fs.chmodSync(ipcSocketPath, 0o777)
}
? `\\\\.\\pipe\\${ipcSocketName}`
: path.join(tmpdir(), `${ipcSocketName}.sock`)
daemonClient.connect(ipcSocketPath, 'localhost', () => {
isConnected = true
console.log('已连接到守护进程');
@@ -20,7 +20,7 @@ export const initDbWorker = () => {
// attach more event
worker?.off('message', handler)
} else if (data.type === 'DB_INIT_FAIL') {
reject(undefined)
reject(data.error)
worker?.terminate()
worker?.off('message', handler)
worker = null