From 664d05be29aa92d3a7cb8ea079b7d519dc629553 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 May 2018 20:06:14 +0200 Subject: [PATCH] AACloud Config Obstacle Passed --- DebugLog.js | 2 +- Root.js | 40 ++++++++++++++++++++-------------------- web.config.json | 38 +++++++++++++++++++++++++++++++++++++- 3 files changed, 58 insertions(+), 22 deletions(-) diff --git a/DebugLog.js b/DebugLog.js index 72e3ee4ef..352bf8719 100644 --- a/DebugLog.js +++ b/DebugLog.js @@ -285,7 +285,6 @@ function deleteLoopFolder(pFolderPath) { - let rimraf = require('rimraf'); let fs = require('fs'); let errosFound = false; @@ -323,6 +322,7 @@ if (errosFound === false) { + let rimraf = require('rimraf'); rimraf.sync(pFolderPath); } diff --git a/Root.js b/Root.js index 93a5c3303..28b6b32dd 100644 --- a/Root.js +++ b/Root.js @@ -30,8 +30,8 @@ exports.newRoot = function newRoot() { } catch (err) { - console.log("[ERROR] Run -> readConfig -> Error Reading the AACloud Config File."); - console.log("[ERROR] Run -> readConfig -> err.message = " + err.message); + console.log("[ERROR] Root -> readConfig -> Error Reading the AACloud Config File."); + console.log("[ERROR] Root -> readConfig -> err.message = " + err.message); return; } @@ -159,7 +159,7 @@ exports.newRoot = function newRoot() { botConfig = JSON.parse(botConfigFile); } catch (err) { - console.log("[ERROR] run -> readBotConfig -> err.message = " + err.message); + console.log("[ERROR] Root -> readBotConfig -> err.message = " + err.message); return; } @@ -174,14 +174,14 @@ exports.newRoot = function newRoot() { botConfig.loopCounter = 0; - if (FULL_LOG === true) { logger.write("[INFO] run -> Processing item from executionList -> p = " + p); } - if (FULL_LOG === true) { logger.write("[INFO] run -> listItem.botPath = " + listItem.botPath); } + if (FULL_LOG === true) { logger.write("[INFO] Root -> Processing item from executionList -> p = " + p); } + if (FULL_LOG === true) { logger.write("[INFO] Root -> listItem.botPath = " + listItem.botPath); } /* File Path Root */ botConfig.filePathRoot = botConfig.devTeam + "/" + botConfig.codeName + "." + botConfig.version.major + "." + botConfig.version.minor + "/" + global.PLATFORM_CONFIG.codeName + "." + global.PLATFORM_CONFIG.version.major + "." + global.PLATFORM_CONFIG.version.minor + "/" + global.EXCHANGE_NAME + "/" + botConfig.dataSetVersion; - if (FULL_LOG === true) { logger.write("[INFO] run -> listItem.process = " + listItem.process); } + if (FULL_LOG === true) { logger.write("[INFO] Root -> listItem.process = " + listItem.process); } /* Now we loop throug all the configured processes at each bots configuration until we find the one we are supposed to run at this Node.js process. */ @@ -192,7 +192,7 @@ exports.newRoot = function newRoot() { if (botConfig.processes[i].name === listItem.process) { processFound = true; - if (FULL_LOG === true) { logger.write("[INFO] run -> Process found at the bot configuration file. -> listItem.process = " + listItem.process); } + if (FULL_LOG === true) { logger.write("[INFO] Root -> Process found at the bot configuration file. -> listItem.process = " + listItem.process); } let processConfig = botConfig.processes[i]; @@ -204,7 +204,7 @@ exports.newRoot = function newRoot() { if (processConfig.startMode.allMonths.run === "true") { - if (FULL_LOG === true) { logger.write("[INFO] run -> allMonths start mode detected. "); } + if (FULL_LOG === true) { logger.write("[INFO] Root -> allMonths start mode detected. "); } for (let year = processConfig.startMode.allMonths.maxYear; year >= processConfig.startMode.allMonths.minYear; year--) { @@ -224,7 +224,7 @@ exports.newRoot = function newRoot() { function startProcess() { - if (FULL_LOG === true) { logger.write("[INFO] run -> startProcess -> Ready to start process."); } + if (FULL_LOG === true) { logger.write("[INFO] Root -> startProcess -> Ready to start process."); } switch (botConfig.type) { case 'Extraction': { @@ -236,7 +236,7 @@ exports.newRoot = function newRoot() { break; } default: { - logger.write("[ERROR] run -> Unexpected bot type. -> botConfig.type = " + botConfig.type); + logger.write("[ERROR] Root -> Unexpected bot type. -> botConfig.type = " + botConfig.type); } } } @@ -249,13 +249,13 @@ exports.newRoot = function newRoot() { if (processConfig.startMode.oneMonth.run === "true") { - if (FULL_LOG === true) { logger.write("[INFO] run -> oneMonth start mode detected. "); } + if (FULL_LOG === true) { logger.write("[INFO] Root -> oneMonth start mode detected. "); } startProcess(); function startProcess() { - if (FULL_LOG === true) { logger.write("[INFO] run -> startProcess -> Ready to start process."); } + if (FULL_LOG === true) { logger.write("[INFO] Root -> startProcess -> Ready to start process."); } let month = pad(processConfig.startMode.oneMonth.month, 2); let year = processConfig.startMode.oneMonth.year; @@ -275,7 +275,7 @@ exports.newRoot = function newRoot() { break; } default: { - logger.write("[ERROR] run -> Unexpected bot type. -> botConfig.type = " + botConfig.type); + logger.write("[ERROR] Root -> Unexpected bot type. -> botConfig.type = " + botConfig.type); } } } @@ -305,7 +305,7 @@ exports.newRoot = function newRoot() { break; } default: { - logger.write("[ERROR] run -> Unexpected bot type. -> botConfig.type = " + botConfig.type); + logger.write("[ERROR] Root -> Unexpected bot type. -> botConfig.type = " + botConfig.type); } } } @@ -327,7 +327,7 @@ exports.newRoot = function newRoot() { break; } default: { - logger.write("[ERROR] run -> Unexpected bot type. -> botConfig.type = " + botConfig.type); + logger.write("[ERROR] Root -> Unexpected bot type. -> botConfig.type = " + botConfig.type); } } } @@ -354,7 +354,7 @@ exports.newRoot = function newRoot() { break; } default: { - logger.write("[ERROR] run -> Unexpected bot type. -> botConfig.type = " + botConfig.type); + logger.write("[ERROR] Root -> Unexpected bot type. -> botConfig.type = " + botConfig.type); } } } @@ -382,7 +382,7 @@ exports.newRoot = function newRoot() { break; } default: { - logger.write("[ERROR] run -> Unexpected bot type. -> botConfig.type = " + botConfig.type); + logger.write("[ERROR] Root -> Unexpected bot type. -> botConfig.type = " + botConfig.type); } } } @@ -407,21 +407,21 @@ exports.newRoot = function newRoot() { break; } default: { - logger.write("[ERROR] run -> Unexpected bot type. -> botConfig.type = " + botConfig.type); + logger.write("[ERROR] Root -> Unexpected bot type. -> botConfig.type = " + botConfig.type); } } } } } catch (err) { - logger.write("[ERROR] run -> Unexpected exception. -> err.message = " + err.message); + logger.write("[ERROR] Root -> Unexpected exception. -> err.message = " + err.message); } } } if (processFound === false) { - logger.write("[ERROR] run -> Process listed at the configuration file of AACloud not found at the configuration file of the bot. -> listItem.process = " + listItem.process); + logger.write("[ERROR] Root -> Process listed at the configuration file of AACloud not found at the configuration file of the bot. -> listItem.process = " + listItem.process); } function runExtractionBot(pBotConfig, pProcessConfig, pMonth, pYear) { diff --git a/web.config.json b/web.config.json index a3c496c04..5b09e72d2 100644 --- a/web.config.json +++ b/web.config.json @@ -1,7 +1,43 @@ { "webModules": [ { - "name": "Run" + "name": "Root" + }, + { + "name": "Assistant" + }, + { + "name": "BlobStorage" + }, + { + "name": "DebugLog" + }, + { + "name": "Context" + }, + { + "name": "DataDependencies" + }, + { + "name": "ExchangeAPI" + }, + { + "name": "StatusDependencies" + }, + { + "name": "StatusReport" + }, + { + "name": "CloudUtilities" + }, + { + "name": "ExtractionBotProcessMainLoop" + }, + { + "name": "IndicatorBotProcessMainLoop" + }, + { + "name": "TradingBotProcessMainLoop" } ] } \ No newline at end of file