Session Errors Implemented

This commit is contained in:
Luis Fernando Molina committed 2020-06-10 14:10:08 +02:00
1 parent ad2a71da62
commit 15a73ef6ab
2 files changed
+45 -12

No files matched your search

+22 -3
View File
@@ -98,6 +98,13 @@
let fixedTimeLoopIntervalHandle;
bot.STOP_SESSION = true;
/* Errors sent to the UI */
bot.sessionError = sessionError
/* Heartbeats sent to the UI */
bot.sessionHeartBeat = sessionHeartBeat
bot.processHeartBeat = processHeartBeat
loop();
function loop() {
@@ -122,9 +129,7 @@
let nextWaitTime;
/* Heartbeats sent to the UI */
bot.sessionHeartBeat = sessionHeartBeat
bot.processHeartBeat = processHeartBeat
/* We tell the UI that we are running. */
processHeartBeat()
/* We define here all the modules that the rest of the infraestructure, including the bots themselves can consume. */
@@ -904,6 +909,20 @@
}
}
function sessionError(node, errorMessage) {
let event = {
nodeName: node.name,
nodeType: node.type,
nodeId: node.id,
errorMessage: errorMessage
}
global.EVENT_SERVER_CLIENT.raiseEvent(bot.sessionKey, 'Error', event)
if (global.STOP_TASK_GRACEFULLY === true) {
bot.STOP_SESSION = true
}
}
function processStopped() {
global.EVENT_SERVER_CLIENT.raiseEvent(bot.processKey, 'Stopped')
}