Restore helper layout in auth, isolation, runtime, and profiles from main
This commit is contained in:
+5
-11
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user