Skip to content

Commit 729e94b

Browse files
committed
WIP: Hard kill server to accelerate shutdown
1 parent 0756243 commit 729e94b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/stop-server.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ const isRunning = (pid: number) => {
1414
}
1515

1616
export async function stopServer(proc: ChildProcess.ChildProcess, token: string) {
17+
hardKill(proc).catch((e) => {
18+
console.log('Error during hard kill of server process:', e);
19+
});
20+
1721
await softShutdown(token)
1822
.catch(console.log); // If that fails, continue shutting down anyway
1923

@@ -31,6 +35,8 @@ export async function stopServer(proc: ChildProcess.ChildProcess, token: string)
3135
break;
3236
}
3337
} while (isRunning(proc.pid!))
38+
39+
console.log('Server process stopped');
3440
}
3541

3642
function softShutdown(token: string) {

0 commit comments

Comments
 (0)