mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-13 01:55:50 -07:00
fix(launcher): handle detached app spawn errors
- Log detached app launch failures before releasing the child process
This commit is contained in:
@@ -37,7 +37,10 @@ test('detached app launch policy stays in the startup runtime utilities', () =>
|
|||||||
|
|
||||||
assert.equal(typeof spawnDetachedApp, 'function');
|
assert.equal(typeof spawnDetachedApp, 'function');
|
||||||
assert.doesNotMatch(entrySource, /function spawnDetachedApp/);
|
assert.doesNotMatch(entrySource, /function spawnDetachedApp/);
|
||||||
assert.match(runtimeSource, /child\.unref\(\)/);
|
assert.match(
|
||||||
|
runtimeSource,
|
||||||
|
/child\.once\('error', \(error\) => \{\s*console\.error\([^;]*error\);\s*\}\);\s*child\.unref\(\)/,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('background bootstrap exits through Electron so Chromium children shut down', () => {
|
test('background bootstrap exits through Electron so Chromium children shut down', () => {
|
||||||
|
|||||||
@@ -280,6 +280,9 @@ export function spawnDetachedApp(childArgs: string[], env: NodeJS.ProcessEnv): v
|
|||||||
stdio: 'ignore',
|
stdio: 'ignore',
|
||||||
env,
|
env,
|
||||||
});
|
});
|
||||||
|
child.once('error', (error) => {
|
||||||
|
console.error('Failed to spawn detached SubMiner app:', error);
|
||||||
|
});
|
||||||
child.unref();
|
child.unref();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user