mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-12 13:55:51 -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.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', () => {
|
||||
|
||||
@@ -280,6 +280,9 @@ export function spawnDetachedApp(childArgs: string[], env: NodeJS.ProcessEnv): v
|
||||
stdio: 'ignore',
|
||||
env,
|
||||
});
|
||||
child.once('error', (error) => {
|
||||
console.error('Failed to spawn detached SubMiner app:', error);
|
||||
});
|
||||
child.unref();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user