mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-08-28 19:46:50 +08:00
change sqlite backend; upgrade electron; fix ipc file cannot listen in macOS
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user