mirror of
https://github.com/engineer-man/piston.git
synced 2025-05-02 09:56:27 +02:00
Use timeout
as fallback for killing process
This commit is contained in:
parent
0ab66f4f5f
commit
81e315609d
1 changed files with 6 additions and 1 deletions
|
@ -121,12 +121,17 @@ class Job {
|
||||||
'--fsize=' + this.runtime.max_file_size,
|
'--fsize=' + this.runtime.max_file_size,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const timeout_call = [
|
||||||
|
'timeout', '-s', '9', Math.ceil(timeout / 1000),
|
||||||
|
];
|
||||||
|
|
||||||
if (memory_limit >= 0) {
|
if (memory_limit >= 0) {
|
||||||
prlimit.push('--as=' + memory_limit);
|
prlimit.push('--as=' + memory_limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
const proc_call = [
|
const proc_call = [
|
||||||
'nice',
|
'nice',
|
||||||
|
...timeout_call,
|
||||||
...prlimit,
|
...prlimit,
|
||||||
...nonetwork,
|
...nonetwork,
|
||||||
'bash',
|
'bash',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue