diff --git a/Multi-Period-Daily/User.Bot.js b/Multi-Period-Daily/User.Bot.js index a8e65157a..3ad65642f 100644 --- a/Multi-Period-Daily/User.Bot.js +++ b/Multi-Period-Daily/User.Bot.js @@ -247,6 +247,9 @@ let n; processDate = new Date(contextVariables.lastBandFile.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(processDate.valueOf()) + let lastDate = new Date() + if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> buildBands -> processDate = " + processDate); } advanceTime(); @@ -275,6 +278,11 @@ } + /* Telling the world we are alive and doing well */ + let currentDateString = processDate.getUTCFullYear() + '-' + utilities.pad(processDate.getUTCMonth() + 1, 2) + '-' + utilities.pad(processDate.getUTCDate(), 2); + let currentDate = new Date(processDate) + bot.processHeartBeat(currentDateString, global.getPercentage(fromDate, currentDate, lastDate)) + periodsLoop(); } catch (err) { @@ -864,7 +872,9 @@ thisReport.file.beginingOfMarket = beginingOfMarket.toUTCString() thisReport.save(callBack); - logger.newInternalLoop(bot.codeName, bot.process, lastFileDate); + if (global.areEqualDates(lastFileDate, new Date()) === false) { + logger.newInternalLoop(bot.codeName, bot.process, lastFileDate); + } } catch (err) { logger.write(MODULE_NAME, "[ERROR] start -> writeStatusReport -> err = " + err.stack); diff --git a/Multi-Period-Market/User.Bot.js b/Multi-Period-Market/User.Bot.js index e85e3a4b1..f5bd3cb5f 100644 --- a/Multi-Period-Market/User.Bot.js +++ b/Multi-Period-Market/User.Bot.js @@ -17,6 +17,7 @@ }; let statusDependencies; + let utilities = UTILITIES.newCloudUtilities(bot, logger); let fileStorage = FILE_STORAGE.newFileStorage(logger); return thisObject; @@ -470,6 +471,15 @@ thisReport.file.lastExecution = bot.processDatetime; thisReport.save(callBack); + if (global.areEqualDates(bot.processDatetime, new Date()) === false) { + logger.newInternalLoop(bot.codeName, bot.process, bot.processDatetime); + } + + /* Telling the world we are alive and doing well */ + let currentDateString = bot.processDatetime.getUTCFullYear() + '-' + utilities.pad(bot.processDatetime.getUTCMonth() + 1, 2) + '-' + utilities.pad(bot.processDatetime.getUTCDate(), 2); + let currentDate = new Date(bot.processDatetime) + let lastDate = new Date() + bot.processHeartBeat(currentDateString, global.getPercentage(currentDate, currentDate, lastDate)) } catch (err) { logger.write(MODULE_NAME, "[ERROR] start -> writeStatusReport -> err = " + err.stack);