diff --git a/.vs/AACloud/v15/.suo b/.vs/AACloud/v15/.suo index 3f51af9d3..03ebdec95 100644 Binary files a/.vs/AACloud/v15/.suo and b/.vs/AACloud/v15/.suo differ diff --git a/Dependencies.js b/Dependencies.js index 214b3fe5a..3962056f6 100644 --- a/Dependencies.js +++ b/Dependencies.js @@ -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; } } } diff --git a/Run.js b/Run.js index b3c17c8c7..a880348a7 100644 --- a/Run.js +++ b/Run.js @@ -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; diff --git a/Status Report.js b/Status Report.js index b9f713d65..ebc2407fd 100644 --- a/Status Report.js +++ b/Status Report.js @@ -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; } diff --git a/this.config.json b/this.config.json index 7ecbde81a..197622311 100644 --- a/this.config.json +++ b/this.config.json @@ -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 } \ No newline at end of file