From f973ecf2818ba56362d5e1fa618703a8adc2209e Mon Sep 17 00:00:00 2001 From: Brikaa Date: Sun, 10 Oct 2021 17:18:31 +0200 Subject: [PATCH] Add infinite timeout --- api/src/job.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/api/src/job.js b/api/src/job.js index c2e8bc8..3ad77c7 100644 --- a/api/src/job.js +++ b/api/src/job.js @@ -143,12 +143,15 @@ class Job { }); } - const kill_timeout = set_timeout(async _ => { - logger.info( - `Timeout exceeded timeout=${timeout} uuid=${this.uuid}` - ); - process.kill(proc.pid, 'SIGKILL'); - }, timeout); + const kill_timeout = + (timeout >= 0 && + set_timeout(async _ => { + logger.info( + `Timeout exceeded timeout=${timeout} uuid=${this.uuid}` + ); + process.kill(proc.pid, 'SIGKILL'); + }, timeout)) || + null; proc.stderr.on('data', async data => { if (eventBus !== null) {