Improvement in health care

This commit is contained in:
Luis Fernando Molina committed 2018-06-08 14:39:19 +02:00
1 parent 55f5d08cbc
commit e1bf2aab7f
3 files changed
+21

No files matched your search

+7
View File
@@ -141,7 +141,9 @@
function loop() {
try {
console.log((new Date().toISOString() + " " + bot.codeName + " " + bot.process + " Entered into Loop # " + (Number(bot.loopCounter) + 1)));
/* For each loop we want to create a new log file. */
const DEBUG_MODULE = require(ROOT_DIR + 'DebugLog');
@@ -474,8 +476,13 @@
if (bot.loopCounter === pLastLoop + 1) { // This means that the next loop started but also stopped executing abruptally.
logger.write(MODULE_NAME, "[ERROR] run -> loop -> checkLoopHealth -> Dying loop found.");
logger.write(MODULE_NAME, "[ERROR] run -> loop -> checkLoopHealth -> pLastLoop = " + pLastLoop);
console.log((new Date().toISOString() + " " + bot.codeName + " " + bot.process + " Loop # " + Number(bot.loopCounter) + " found dead. Resurrecting it now."));
logger.persist(); // We persist the logs of the failed execution.
loop(); // We restart the loop so that the processing can continue.
}
}