fix(dev): stop stale frontend when portal exits
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
deepseekDisableThinkingEnabled,
|
||||
resolveDeepseekNoThinkListenPort,
|
||||
} from '../deepseek-no-think-proxy.mjs';
|
||||
import { handleUnexpectedChildExit } from './dev-process-lifecycle.mjs';
|
||||
|
||||
const root = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const opsDir = path.join(root, 'ops');
|
||||
@@ -52,11 +53,13 @@ function spawnChild(command, args, label, cwd = root, extraEnv = {}) {
|
||||
stdio: 'inherit',
|
||||
});
|
||||
child.on('exit', (code, signal) => {
|
||||
if (signal) return;
|
||||
if (code && code !== 0) {
|
||||
console.error(`[${label}] exited with code ${code}`);
|
||||
shutdown(code ?? 1);
|
||||
}
|
||||
handleUnexpectedChildExit({
|
||||
label,
|
||||
code,
|
||||
signal,
|
||||
stopping,
|
||||
shutdown,
|
||||
});
|
||||
});
|
||||
return child;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user