diff --git a/Root.js b/Root.js index a6c16f8bf..8c82a8125 100644 --- a/Root.js +++ b/Root.js @@ -138,9 +138,9 @@ const FILE_STORAGE = require('./FileStorage.js'); let fileStorage = FILE_STORAGE.newFileStorage(); - let filePath = global.TASK_NODE.bot.processes[processIndex].code.team + '/bots/' + global.TASK_NODE.bot.processes[processIndex].code.repo + '/this.bot.config.json'; + let filePath = global.TASK_NODE.bot.code.team + '/bots/' + global.TASK_NODE.bot.code.repo + '/this.bot.config.json'; - fileStorage.getTextFile(global.TASK_NODE.bot.processes[processIndex].code.team, filePath, onFileReceived); + fileStorage.getTextFile(global.TASK_NODE.bot.code.team, filePath, onFileReceived); function onFileReceived(err, text) { @@ -152,7 +152,7 @@ try { botConfig = JSON.parse(text); - botConfig.repo = global.TASK_NODE.bot.processes[processIndex].code.repo; + botConfig.repo = global.TASK_NODE.bot.code.repo; findProcess(processIndex); } catch (err) { console.log(logDisplace + "Root : [ERROR] start -> getBotConfig -> onInizialized -> onFileReceived -> err = " + JSON.stringify(err)); diff --git a/server.js b/server.js index 2f6d854aa..06b328085 100644 --- a/server.js +++ b/server.js @@ -127,7 +127,7 @@ global.EXIT_NODE_PROCESS = function exitProcess() { /* Delete the event handler for each process. */ - let key = code.team + "-" + code.bot + "-" + code.process + let key = global.TASK_NODE.bot.code.team + "-" + global.TASK_NODE.bot.code.bot + "-" + code.process global.SYSTEM_EVENT_HANDLER.deleteEventHandler(key) @@ -174,13 +174,13 @@ function bootLoader() { /* Validate that the minimun amount of parameters required are defined. */ - if (global.TASK_NODE.bot.processes[processIndex].code.bot === undefined) { - console.log("[INFO] Task Server -> server -> bootLoader -> Parameter 'bot' is undefined. This process will not be executed. -> Process = " + global.TASK_NODE.bot.processes[processIndex].name); + if (global.TASK_NODE.bot.code.bot === undefined) { + console.log("[INFO] Task Server -> server -> bootLoader -> Parameter 'bot' at the Indicator | Sensor | Trading Engine is undefined. This process will not be executed. -> Process = " + global.TASK_NODE.bot.processes[processIndex].name); continue } - if (global.TASK_NODE.bot.processes[processIndex].code.team === undefined) { - console.log("[INFO] Task Server -> server -> bootLoader -> Parameter 'team' is undefined. This process will not be executed. -> Process = " + global.TASK_NODE.bot.processes[processIndex].name); + if (global.TASK_NODE.bot.code.team === undefined) { + console.log("[INFO] Task Server -> server -> bootLoader -> Parameter 'team' at the bot is undefined. This process will not be executed. -> Process = " + global.TASK_NODE.bot.processes[processIndex].name); continue } @@ -191,11 +191,11 @@ function bootLoader() { /* Create the event handler for each process. This event handlers are where the status reports updated events are raised. */ - let key = code.team + "-" + code.bot + "-" + code.process + let key = global.TASK_NODE.bot.code.team + "-" + global.TASK_NODE.bot.code.bot + "-" + code.process global.SYSTEM_EVENT_HANDLER.createEventHandler(key) - if (global.TASK_NODE.bot.processes[processIndex].code.repo === undefined) { - global.TASK_NODE.bot.processes[processIndex].code.repo = global.TASK_NODE.bot.processes[processIndex].code.bot + "-" + global.TASK_NODE.bot.type + "-Bot" + if (global.TASK_NODE.bot.code.repo === undefined) { + global.TASK_NODE.bot.code.repo = global.TASK_NODE.bot.code.bot + "-" + global.TASK_NODE.bot.type + "-Bot" } startRoot(processIndex);