Commit 3313c70b authored by Daniel Smith's avatar Daniel Smith

Bugfixes

parent f0066c53
......@@ -239,15 +239,15 @@ function queryAgentJobs(req, res) {
console.log(`Received remote jobs from ${globals.agents[i]}. Updating local lists...`);
// Check to make sure the response isn't a literal empty object such as '{}'
if (Object.entries(response.data.runningJob).length > 2)
toolbox.addJobtoArray(globals.remoteRunningJobs, response.data.runningJob);
toolbox.addJobToArray(globals.remoteRunningJobs, response.data.runningJob);
if (response.data.queuedJobs.length > 0) {
for (let j in response.data.queuedJobs)
toolbox.addJobtoArray(globals.remoteQueuedJobs, response.data.queryJobs[j]);
toolbox.addJobToArray(globals.remoteQueuedJobs, response.data.queryJobs[j]);
}
readyEmitter.emit("agentFinished");
}).catch((error) => {
// Just a WARN because it's not fatal that one of our remote hosts is offline for a minute
console.log(`WARN: Failed to query ${globals.agents[i]} for jobs`);
console.log(`WARN: Failed to query ${globals.agents[i]} for jobs\nError${error}`);
readyEmitter.emit("agentFinished");
});
}
......
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