From 4bda68fd2bc54ec0a8831370f190f32dd4e866a4 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 20 Mar 2020 11:02:27 +0100 Subject: [PATCH] logging improved --- Multi-Period-Daily/User.Bot.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Multi-Period-Daily/User.Bot.js b/Multi-Period-Daily/User.Bot.js index 3ad65642f..8c27945fd 100644 --- a/Multi-Period-Daily/User.Bot.js +++ b/Multi-Period-Daily/User.Bot.js @@ -281,8 +281,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(); } catch (err) { @@ -872,9 +876,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);