Restore helper layout in auth, isolation, runtime, and profiles from main

This commit is contained in:
Danny Kim
2026-10-17 18:49:28 +09:00
parent 0c5059e3b4
commit cd1864e1a9
5 changed files with 40 additions and 59 deletions
+5 -11
View File
@@ -49,16 +49,6 @@ async function profileProcessIds(uid: number): Promise<number[]> {
.map(Number);
}
function killProcess(pid: number): void {
try {
process.kill(pid, "SIGKILL");
} catch (error) {
if (!isNotFound(error)) {
throw error;
}
}
}
// Kills the UID's processes every 10 ms until none is left, for up to 100 rounds.
export async function killProfileProcesses(uid: number, attempt = 0): Promise<void> {
if (attempt === 100) {
@@ -69,7 +59,11 @@ export async function killProfileProcesses(uid: number, attempt = 0): Promise<vo
return;
}
for (const pid of ids) {
killProcess(pid);
try {
process.kill(pid, "SIGKILL");
} catch (error) {
if (!isNotFound(error)) throw error;
}
}
await sleep(10);
await killProfileProcesses(uid, attempt + 1);