mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
fix(server): block dev-runner on Ctrl-C until supervisor finishes shutting down
The spawnSync parent had no signal handlers, so SIGINT killed it immediately while the supervisor kept running in the background. The shell prompt came back before the daemon had actually drained. Install no-op SIGINT/SIGTERM handlers so spawnSync waits for the supervisor's graceful exit.
This commit is contained in:
@@ -8,6 +8,14 @@ dotenv.config({
|
||||
});
|
||||
|
||||
const daemonRunnerEntry = fileURLToPath(new URL("./supervisor-entrypoint.ts", import.meta.url));
|
||||
|
||||
// The supervisor handles SIGINT/SIGTERM itself and needs time to drain the
|
||||
// worker gracefully. Ignore them here so spawnSync blocks until the supervisor
|
||||
// finishes shutting down, instead of the parent dying on Ctrl-C and releasing
|
||||
// the shell while the daemon is still logging.
|
||||
process.on("SIGINT", () => {});
|
||||
process.on("SIGTERM", () => {});
|
||||
|
||||
const result = spawnSync(
|
||||
process.execPath,
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user