Use `timeout` as fallback for killing process

This commit is contained in:
Thomas Hobson 2022-04-27 03:05:29 +12:00 committed by GitHub
parent 0ab66f4f5f
commit 81e315609d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -121,12 +121,17 @@ class Job {
'--fsize=' + this.runtime.max_file_size,
];
const timeout_call = [
'timeout', '-s', '9', Math.ceil(timeout / 1000),
];
if (memory_limit >= 0) {
prlimit.push('--as=' + memory_limit);
}
const proc_call = [
'nice',
...timeout_call,
...prlimit,
...nonetwork,
'bash',