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

Fix remote job cancelling

parent 0bf8fc43
...@@ -276,6 +276,7 @@ function cancelJob(req, res) { ...@@ -276,6 +276,7 @@ function cancelJob(req, res) {
if (targetIndex == -1) { if (targetIndex == -1) {
return; return;
} else { } else {
jobFound = true;
let remoteIP = globals.hosts[globals.hosts.findIndex((x) => x.hostname ==targetArray[targetIndex].test_hosts[0])].ip 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 }) axios.get(`http://${remoteIP}:${globals.webPort}/cancelJob?jobHash=${req.query.jobHash}`, { timeout: 2000 })
.then((response) => { .then((response) => {
......
...@@ -32,7 +32,7 @@ exports.getIndex = getIndex; ...@@ -32,7 +32,7 @@ exports.getIndex = getIndex;
function getIndex(targetArray, jobHash) { function getIndex(targetArray, jobHash) {
let index = -1; let index = -1;
try { try {
targetArray[targetArray.findIndex((j) => j.jobHash == jobHash)] index = targetArray[targetArray.findIndex((j) => j.jobHash == jobHash)]
} catch (exception) { } catch (exception) {
return index; 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