Merge pull request #371 from Brikaa/timeout

-1 for no timeout (infinite timeout)
This commit is contained in:
Thomas Hobson 2021-10-13 23:15:29 +13:00 committed by GitHub
commit 94a5568121
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View File

@ -146,12 +146,15 @@ class Job {
}); });
} }
const kill_timeout = set_timeout(async _ => { const kill_timeout =
logger.info( (timeout >= 0 &&
`Timeout exceeded timeout=${timeout} uuid=${this.uuid}` set_timeout(async _ => {
); logger.info(
process.kill(proc.pid, 'SIGKILL'); `Timeout exceeded timeout=${timeout} uuid=${this.uuid}`
}, timeout); );
process.kill(proc.pid, 'SIGKILL');
}, timeout)) ||
null;
proc.stderr.on('data', async data => { proc.stderr.on('data', async data => {
if (eventBus !== null) { if (eventBus !== null) {