One more server exception fix.

This commit is contained in:
Ylian Saint-Hilaire 2021-01-25 11:08:59 -08:00
parent d7a3ed5693
commit b9af7924a2
1 changed files with 4 additions and 4 deletions

View File

@ -1159,11 +1159,14 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
} }
case 'coreinfo': case 'coreinfo':
{ {
// Sent by the agent to update agent information
ChangeAgentCoreInfo(command);
if ((obj.agentCoreUpdate === true) && (obj.agentExeInfo != null)) { if ((obj.agentCoreUpdate === true) && (obj.agentExeInfo != null)) {
// Agent update. The recovery core was loaded in the agent, send a command to update the agent // Agent update. The recovery core was loaded in the agent, send a command to update the agent
parent.parent.taskLimiter.launch(function (argument, taskid, taskLimiterQueue) { // Medium priority task parent.parent.taskLimiter.launch(function (argument, taskid, taskLimiterQueue) { // Medium priority task
// If agent disconnection, complete and exit now. // If agent disconnection, complete and exit now.
if (obj.authenticated != 2) { parent.parent.taskLimiter.completed(taskid); return; } if ((obj.authenticated != 2) || (obj.agentExeInfo == null)) { parent.parent.taskLimiter.completed(taskid); return; }
// Agent update. The recovery core was loaded in the agent, send a command to update the agent // Agent update. The recovery core was loaded in the agent, send a command to update the agent
obj.agentCoreUpdateTaskId = taskid; obj.agentCoreUpdateTaskId = taskid;
@ -1183,9 +1186,6 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
// Send the agent update command // Send the agent update command
obj.send(JSON.stringify(cmd)); obj.send(JSON.stringify(cmd));
}, null, 1); }, null, 1);
} else {
// Sent by the agent to update agent information
ChangeAgentCoreInfo(command);
} }
break; break;
} }