Merge remote-tracking branch 'upstream/develop'
This commit is contained in:
commit
95e33ec258
5 files changed
+36
-20
No files matched your search
+1
-7
@@ -9,10 +9,4 @@ bin/*
|
||||
*.cache
|
||||
node_modules/*
|
||||
exchange/Auth0.js
|
||||
configs/Email.Config.json
|
||||
|
||||
configs/User.Profile.json
|
||||
configs/Execution.Config.json
|
||||
configs/Secret.Keys.json
|
||||
*.env
|
||||
*.vscode*
|
||||
.env
|
||||
+7
-1
@@ -30,7 +30,8 @@
|
||||
rememberThis: rememberThis,
|
||||
remindMeOf: remindMeOf,
|
||||
truncDecimals: truncDecimals,
|
||||
sendEmail: sendEmail
|
||||
sendEmail: sendEmail,
|
||||
addExtraData: addExtraData
|
||||
};
|
||||
|
||||
let utilities = UTILITIES.newCloudUtilities(bot, logger);
|
||||
@@ -1363,6 +1364,11 @@
|
||||
return;
|
||||
}
|
||||
|
||||
function addExtraData(pExtraDataArray) {
|
||||
|
||||
context.extraData = pExtraDataArray;
|
||||
}
|
||||
|
||||
function truncDecimals(pFloatValue, pDecimals) {
|
||||
|
||||
if (!pDecimals) pDecimals = 8; // Default value
|
||||
|
||||
+5
-2
@@ -45,7 +45,8 @@
|
||||
messageBody: ""
|
||||
},
|
||||
initialize: initialize,
|
||||
saveThemAll: saveThemAll
|
||||
saveThemAll: saveThemAll,
|
||||
extraData: []
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -492,7 +493,9 @@
|
||||
thisObject.newHistoryRecord.messageBody
|
||||
];
|
||||
|
||||
thisObject.executionHistory.push(newRecord);
|
||||
let recordWithExtraData = newRecord.concat(thisObject.extraData);
|
||||
|
||||
thisObject.executionHistory.push(recordWithExtraData);
|
||||
|
||||
let fileContent = JSON.stringify(thisObject.executionHistory);
|
||||
|
||||
|
||||
+17
-6
@@ -233,8 +233,13 @@
|
||||
|
||||
if (thisReport.lastFile !== undefined) {
|
||||
|
||||
contextVariables.lastFile = new Date(thisReport.lastFile);
|
||||
if (bot.hasTheBotJustStarted === true && processConfig.framework.startDate.resumeExecution === "false") {
|
||||
|
||||
startFromBegining();
|
||||
return;
|
||||
}
|
||||
|
||||
contextVariables.lastFile = new Date(thisReport.lastFile);
|
||||
interExecutionMemoryArray = thisReport.interExecutionMemoryArray;
|
||||
|
||||
processTimePeriods();
|
||||
@@ -246,10 +251,16 @@
|
||||
In the case when there is no status report, we assume like the last processed file is the one on the date of Begining of Market.
|
||||
*/
|
||||
|
||||
startFromBegining();
|
||||
return;
|
||||
}
|
||||
|
||||
function startFromBegining() {
|
||||
|
||||
contextVariables.lastFile = new Date(contextVariables.dateBeginOfMarket.getUTCFullYear() + "-" + (contextVariables.dateBeginOfMarket.getUTCMonth() + 1) + "-" + contextVariables.dateBeginOfMarket.getUTCDate() + " " + "00:00" + GMT_SECONDS);
|
||||
|
||||
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> getContextVariables -> thisReport.lastFile === undefined"); }
|
||||
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> getContextVariables -> contextVariables.lastFile = " + contextVariables.lastFile); }
|
||||
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> getContextVariables -> startFromBegining -> thisReport.lastFile === undefined"); }
|
||||
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> getContextVariables -> startFromBegining -> contextVariables.lastFile = " + contextVariables.lastFile); }
|
||||
|
||||
/*
|
||||
The first time the process is running is the right time to create the data structure that is going to be shared across different executions.
|
||||
@@ -258,14 +269,13 @@
|
||||
|
||||
interExecutionMemoryArray = [];
|
||||
|
||||
for (let i = 0; i < global.dailyFilePeriods.length; i++)
|
||||
{
|
||||
for (let i = 0; i < global.dailyFilePeriods.length; i++) {
|
||||
let emptyObject = {};
|
||||
interExecutionMemoryArray.push(emptyObject);
|
||||
}
|
||||
|
||||
processTimePeriods();
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
@@ -734,6 +744,7 @@
|
||||
thisReport.file.interExecutionMemoryArray = interExecutionMemoryArray;
|
||||
thisReport.save(callBack);
|
||||
|
||||
bot.hasTheBotJustStarted = false;
|
||||
}
|
||||
catch (err) {
|
||||
logger.write(MODULE_NAME, "[ERROR] start -> writeStatusReport -> err = " + err.message);
|
||||
|
||||
@@ -288,11 +288,13 @@
|
||||
processConfig.timePeriod = global.EXECUTION_CONFIG.timePeriod
|
||||
}
|
||||
|
||||
if (processConfig.framework.name === "Multi-Period-Daily") {
|
||||
processConfig.framework.startDate.fixedDate = processConfig.startMode.noTime.beginDatetime;
|
||||
processConfig.framework.startDate.resumeExecution = processConfig.startMode.noTime.resumeExecution;
|
||||
if (processConfig.framework !== undefined) {
|
||||
if (processConfig.framework.name === "Multi-Period-Daily") {
|
||||
processConfig.framework.startDate.fixedDate = processConfig.startMode.noTime.beginDatetime;
|
||||
processConfig.framework.startDate.resumeExecution = processConfig.startMode.noTime.resumeExecution;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
|
||||
/* We test each type of start Mode to get what to run and how. */
|
||||
|
||||
Reference in new issue
Block a user