Status implementation

This commit is contained in:
Luis Fernando Molina committed 2020-03-20 14:13:25 +01:00
1 parent b0bfc632e4
commit 4aaeb1dd27
20 files changed
+357 -65

No files matched your search

+12 -5
View File
@@ -307,6 +307,8 @@
let botNeverRan = true;
bot.multiPeriodDailyProcessDatetime = new Date(contextVariables.lastFile.valueOf() - ONE_DAY_IN_MILISECONDS); // Go back one day to start well when we advance time at the begining of the loop.
let fromDate = new Date(bot.multiPeriodDailyProcessDatetime.valueOf())
let lastDate = new Date()
advanceTime();
@@ -334,6 +336,16 @@
}
/* Telling the world we are alive and doing well */
let currentDateString = bot.multiPeriodDailyProcessDatetime.getUTCFullYear() + '-' + utilities.pad(bot.multiPeriodDailyProcessDatetime.getUTCMonth() + 1, 2) + '-' + utilities.pad(bot.multiPeriodDailyProcessDatetime.getUTCDate(), 2);
let currentDate = new Date(bot.multiPeriodDailyProcessDatetime)
let percentage = global.getPercentage(fromDate, currentDate, lastDate)
bot.processHeartBeat(currentDateString, percentage)
if (global.areEqualDates(currentDate, new Date()) === false) {
logger.newInternalLoop(bot.codeName, bot.process, currentDate, percentage);
}
checkStopTaskGracefully();
} catch (err) {
@@ -371,10 +383,6 @@
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> processTimeFrames -> periodsLoop -> Entering function."); }
/* Telling the world we are alive and doing well */
let processingDate = bot.multiPeriodDailyProcessDatetime.getUTCFullYear() + '-' + utilities.pad(bot.multiPeriodDailyProcessDatetime.getUTCMonth() + 1, 2) + '-' + utilities.pad(bot.multiPeriodDailyProcessDatetime.getUTCDate(), 2);
bot.processHeartBeat(processingDate)
/*
We will iterate through all posible periods.
@@ -808,7 +816,6 @@
bot.hasTheBotJustStarted = false;
logger.newInternalLoop(bot.codeName, bot.process, bot.multiPeriodDailyProcessDatetime);
}
catch (err) {
logger.write(MODULE_NAME, "[ERROR] start -> writeStatusReport -> err = "+ err.stack);