diff --git a/src/main/core/manager.ts b/src/main/core/manager.ts index f9cca08..e062bf0 100644 --- a/src/main/core/manager.ts +++ b/src/main/core/manager.ts @@ -113,7 +113,7 @@ export async function startCore(detached = false): Promise[]> { corePath, ['-d', diffWorkDir ? mihomoProfileWorkDir(current) : mihomoWorkDir(), ctlParam, mihomoIpcPath], { - detached: detached, + detached: true, stdio: detached ? 'ignore' : undefined, env: env } @@ -218,7 +218,7 @@ export async function restartCore(): Promise { export async function keepCoreAlive(): Promise { try { - await startCore(true) + if (!child) await startCore(true) if (child && child.pid) { await writeFile(path.join(dataDir(), 'core.pid'), child.pid.toString()) }