From 8f40a1253f40bdee9dd4e5d16eab2d1f196ded0a Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Thu, 30 Jul 2020 13:37:47 +0200 Subject: [PATCH] Fix remote job cancelling --- server.js | 1 + toolbox.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 7a87622..c3f6081 100644 --- a/server.js +++ b/server.js @@ -276,6 +276,7 @@ function cancelJob(req, res) { if (targetIndex == -1) { return; } else { + jobFound = true; let remoteIP = globals.hosts[globals.hosts.findIndex((x) => x.hostname ==targetArray[targetIndex].test_hosts[0])].ip axios.get(`http://${remoteIP}:${globals.webPort}/cancelJob?jobHash=${req.query.jobHash}`, { timeout: 2000 }) .then((response) => { diff --git a/toolbox.js b/toolbox.js index 67ba74d..208a1d9 100644 --- a/toolbox.js +++ b/toolbox.js @@ -32,7 +32,7 @@ exports.getIndex = getIndex; function getIndex(targetArray, jobHash) { let index = -1; try { - targetArray[targetArray.findIndex((j) => j.jobHash == jobHash)] + index = targetArray[targetArray.findIndex((j) => j.jobHash == jobHash)] } catch (exception) { return index; } -- GitLab