Hole Fixing Partially debuged

This commit is contained in:
Luis Fernando Molina committed 2018-03-19 15:48:34 +01:00
1 parent 44e0d71377
commit 7064de6e01
5 files changed
+37 -22

No files matched your search

Binary file not shown.
+21 -18
View File
@@ -7,15 +7,14 @@
let thisObject = {
statusReports: new Map(),
initialize: initialize
initialize: initialize,
key: []
};
/*
During the process we will create a new History Record. This will go to the Context History file which essentially mantains an
index of all the bots executions. This file will later be plotted by the bot s plotter on the timeline, allowing end users to
know where there is information related to the actions taken by the bot.
*/
let bot = BOT;
@@ -52,11 +51,8 @@
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
logger.write("[ERROR] initialize -> onInitilized -> err = " + err.message);
if (alreadyCalledBack === false) {
callBackFunction(err);
} else {
alreadyCalledBack = true;
}
alreadyCalledBack = true;
callBackFunction(err);
return;
}
@@ -69,29 +65,31 @@
switch (err.result) {
case global.DEFAULT_OK_RESPONSE.result: {
logger.write("[INFO] initialize -> onLoad -> Execution finished well -> bot = " + pDependenciesConfig[i].bot);
logger.write("[INFO] initialize -> onLoad -> Execution finished well. -> bot = " + pDependenciesConfig[i].bot);
logger.write("[INFO] initialize -> onLoad -> Execution finished well. -> process = " + pDependenciesConfig[i].process);
addReport();
return;
}
case global.CUSTOM_OK_RESPONSE.result: { // We need to see if we can handle this.
logger.write("[ERROR] initialize -> onLoad -> err.message = " + err.message);
if (err.message === "Status Report was never created.") {
logger.write("[ERROR] initialize -> onLoad -> err.message = " + err.message);
logger.write("[ERROR] initialize -> onLoad -> Report Not Found. -> bot = " + pDependenciesConfig[i].bot);
logger.write("[WARN] initialize -> onLoad -> err.message = " + err.message);
logger.write("[WARN] initialize -> onLoad -> Report Not Found. -> bot = " + pDependenciesConfig[i].bot);
logger.write("[WARN] initialize -> onLoad -> Report Not Found. -> process = " + pDependenciesConfig[i].process);
addReport();
return;
} else {
logger.write("[WARN] initialize -> onLoad -> Response not understood.");
logger.write("[ERROR] initialize -> onLoad -> Response not understood. -> err.message = " + err.message);
logger.write("[ERROR] initialize -> onLoad -> Response not understood. -> bot = " + pDependenciesConfig[i].bot);
logger.write("[ERROR] initialize -> onLoad -> Response not understood. -> process = " + pDependenciesConfig[i].process);
if (alreadyCalledBack === false) {
callBackFunction(err);
} else {
alreadyCalledBack = true;
}
callBackFunction(err);
}
return;
}
}
@@ -100,9 +98,8 @@
logger.write("[ERROR] initialize -> onLoad -> Operation Failed.");
if (alreadyCalledBack === false) {
callBackFunction(err);
} else {
alreadyCalledBack = true;
callBackFunction(err);
}
return;
}
@@ -116,6 +113,8 @@
function addReport() {
if (FULL_LOG === true) { logger.write("[INFO] initialize -> addReport -> Entering function."); }
loadCount++;
let key;
@@ -126,11 +125,15 @@
key = pDependenciesConfig[i].devTeam + "-" + pDependenciesConfig[i].bot + "-" + pDependenciesConfig[i].process + "-" + pDependenciesConfig[i].dataSetVersion;
}
thisObject.key.push(key);
thisObject.statusReports.set(key, statusReportModule);
if (FULL_LOG === true) { logger.write("[INFO] initialize -> addReport -> Report added to Map. -> key = " + key); }
if (loadCount === pDependenciesConfig.length) {
if (alreadyCalledBack === false) {
callBackFunction(global.DEFAULT_OK_RESPONSE);
return;
}
}
}
+6
View File
@@ -139,6 +139,12 @@ for (let p = 0; p < global.PLATFORM_CONFIG.executionList.length; p++) {
let listItem = PLATFORM_CONFIG.executionList[p];
if (listItem.enabled !== "true") {
console.log("[INFO] Skipping process " + listItem.process + " for being disabled. ");
continue;
}
/* Now we will read the config of the bot from the path we obtained at the AACloud config. */
let botConfig;
+2 -3
View File
@@ -25,7 +25,6 @@
let owner; // This is the bot owner of the Status Report. Only owners can save the report and override the existing content.
const logger = DEBUG_MODULE.newDebugLog();
logger.fileName = MODULE_NAME;
logger.bot = bot;
/* Utilities needed. */
@@ -46,7 +45,7 @@
try {
logger.fileName = MODULE_NAME + "." + pOwner.bot;
logger.fileName = MODULE_NAME + "." + pOwner.bot + "." + pOwner.process;
owner = pOwner;
month = pMonth;
@@ -54,7 +53,7 @@
if (owner.dataSetSection === "Month") {
logger.fileName = MODULE_NAME + "." + pOwner.bot + "." + year + "." + month;
logger.fileName = MODULE_NAME + "." + pOwner.bot + "." + pOwner.process + "." + year + "." + month;
timePath = "/" + year + "/" + month;
}
+8 -1
View File
@@ -7,16 +7,23 @@
},
"executionList": [
{
"enabled": "false",
"botPath": "../Bots/AAMasters/AAMariam-Trading-Bot",
"process": "Trading-Process"
},
{
"enabled": "false",
"botPath": "../Bots/AAMasters/AAOlivia-Indicator-Bot",
"process": "Multi-Period-Market"
},
{
"enabled": "true",
"botPath": "../Bots/AAMasters/AACharly-Extraction-Bot",
"process": "Poloniex-Hole-Fixing"
}
],
"stopGracefully": "true",
"exchangeSimulationMode": "false",
"storageConnStringFolder": "Mixed",
"storageConnStringFolder": "Testnet",
"maxLogLoops": 10
}