Commit 8f40a125 authored by Daniel Smith's avatar Daniel Smith

Fix remote job cancelling

parent 0bf8fc43
......@@ -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) => {
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment