From fdd25e56a0766732718a79ce347b55eb2e4ab6e8 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 20 Mar 2020 11:02:37 +0100 Subject: [PATCH] logging improved --- Multi-Period-Daily/User.Bot.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Multi-Period-Daily/User.Bot.js b/Multi-Period-Daily/User.Bot.js index 21d650bef..355c49f61 100644 --- a/Multi-Period-Daily/User.Bot.js +++ b/Multi-Period-Daily/User.Bot.js @@ -288,7 +288,12 @@ /* 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)) + 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); + } periodsLoop(); @@ -1627,9 +1632,6 @@ thisReport.file.beginingOfMarket = beginingOfMarket.toUTCString() thisReport.save(callBack); - 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);