diff --git a/server.js b/server.js index 7a87622bccbb6bb6a1e07c2f809f6fdad4f86a10..c3f6081a7f92b8a59757de826b8d49738d811fea 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 67ba74d9723ea84eb4a8f744a9029d21af7a215e..208a1d983b620d6e5011a0a9b5299497db68f125 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; }