fix: harden atomic file writes (#1453)

Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
nerdosaurus
2026-06-08 20:06:20 +03:00
committed by GitHub
co-authored by Bohdan Triapitsyn
parent c2ca844402
commit e6338e5c71
3 changed files with 123 additions and 15 deletions
-7
View File
@@ -146,13 +146,6 @@ async function shutdown(exitCode = 0) {
if (shuttingDown) return;
shuttingDown = true;
await Promise.all([stopChildTree(api), stopChildTree(vite)]);
// Clean up orphaned OpenCode processes that weren't killed by
// the Express server's shutdown (e.g. when nodemon is killed first).
try {
spawnSync('pkill', ['-f', 'opencode serve'], { stdio: 'ignore' });
} catch {
// best-effort
}
process.exit(exitCode);
}