mirror of
https://github.com/engineer-man/piston.git
synced 2025-06-07 18:56:26 +02:00
Merge pull request #371 from Brikaa/timeout
-1 for no timeout (infinite timeout)
This commit is contained in:
commit
94a5568121
1 changed files with 9 additions and 6 deletions
|
@ -146,12 +146,15 @@ class Job {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const kill_timeout = set_timeout(async _ => {
|
const kill_timeout =
|
||||||
|
(timeout >= 0 &&
|
||||||
|
set_timeout(async _ => {
|
||||||
logger.info(
|
logger.info(
|
||||||
`Timeout exceeded timeout=${timeout} uuid=${this.uuid}`
|
`Timeout exceeded timeout=${timeout} uuid=${this.uuid}`
|
||||||
);
|
);
|
||||||
process.kill(proc.pid, 'SIGKILL');
|
process.kill(proc.pid, 'SIGKILL');
|
||||||
}, timeout);
|
}, timeout)) ||
|
||||||
|
null;
|
||||||
|
|
||||||
proc.stderr.on('data', async data => {
|
proc.stderr.on('data', async data => {
|
||||||
if (eventBus !== null) {
|
if (eventBus !== null) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue