Legacy Code Reorganized

This commit is contained in:
Luis Fernando Molina committed 2020-11-21 13:09:29 +01:00
1 parent f4113ce2cb
commit 37a7ca9228
39 files changed
+37 -34

No files matched your search

-2
View File
@@ -1,11 +1,9 @@
INTER_PROCESS_FILES_PATH=../Inter-Process-Files
STORAGE_PATH=../Data-Storage
PLOTTERS_PATH=../Legacy-Code
USE_KEYVAULT=false
WRITE_LOGS_TO_FILES=true
BOTS_PATH=../Legacy-Code
LOG_PATH=../Log-Files
WEB_SOCKETS_INTERFACE_PORT=18041
+1 -1
View File
@@ -74,7 +74,7 @@ exports.newFileStorage = function newFileStorage(logger, host, port) {
let fileLocation
let mustBeJason
if (filePath.indexOf("/bots/") > 0) {
fileLocation = process.env.BOTS_PATH + '/' + filePath
fileLocation = process.env.PROJECTS_PATH + '/' + filePath
mustBeJason = false
} else {
fileLocation = process.env.STORAGE_PATH + '/' + filePath
+8 -2
View File
@@ -36,7 +36,13 @@
}
/* This bot is not ready for taking its code from the UI, then we need to load it from its repo. */
let filePath = bot.dataMine + "/" + "bots" + "/" + bot.processNode.referenceParent.parentNode.config.repo + "/" + pProcessConfig.codeName
let filePath =
bot.processNode.referenceParent.parentNode.parentNode.project + // project
'/Bots-Plotters-Code/' +
bot.dataMine +
"/" + "bots" + "/" +
bot.processNode.referenceParent.parentNode.config.repo + "/" +
pProcessConfig.codeName
filePath += "/User.Bot.js"
fileStorage.getTextFile(filePath, onBotDownloaded);
@@ -54,7 +60,7 @@
USER_BOT_MODULE = {}
USER_BOT_MODULE.newUserBot = eval(text); // TODO This needs to be changed function
filePath = bot.dataMine + "/" + "bots" + "/" + bot.processNode.referenceParent.parentNode.config.repo
filePath = bot.dataMine + "/" + "bots" + "/" + bot.processNode.referenceParent.parentNode.config.repo
filePath += "/Commons.js"
fileStorage.getTextFile(filePath, onCommonsDownloaded);
+8 -2
View File
@@ -140,7 +140,13 @@
const FILE_STORAGE = require('./FileStorage.js');
let fileStorage = FILE_STORAGE.newFileStorage();
let filePath = global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + '/bots/' + processInstance.referenceParent.parentNode.config.repo + '/this.bot.config.json';
let filePath =
global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.project + // project
'/Bots-Plotters-Code/' +
global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + // mine
'/bots/' +
processInstance.referenceParent.parentNode.config.repo + // bot
'/this.bot.config.json'
fileStorage.getTextFile(filePath, onFileReceived);
@@ -554,7 +560,7 @@
setTimeout(exitProcessInstance, WAIT_TIME_FOR_ALL_PROCESS_INSTANCES_TO_START)
}
}
function runLearningBot(pBotConfig, pProcessConfig) {
global.TOTAL_PROCESS_INSTANCES_CREATED++
+8 -2
View File
@@ -34,7 +34,13 @@
return
}
let filePath = bot.dataMine + "/" + "bots" + "/" + bot.processNode.referenceParent.parentNode.config.repo + "/" + pProcessConfig.codeName
let filePath =
bot.processNode.referenceParent.parentNode.parentNode.project + // project
'/Bots-Plotters-Code/' +
bot.dataMine +
"/" + "bots" + "/" +
bot.processNode.referenceParent.parentNode.config.repo + "/" +
pProcessConfig.codeName
filePath += "/User.Bot.js"
fileStorage.getTextFile(filePath, onBotDownloaded);
@@ -63,7 +69,7 @@
function onCommonsDownloaded(err, text) {
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
parentLogger.write(MODULE_NAME, "[WARN] initialize -> onBotDownloaded -> onCommonsDownloaded -> Commons not found: " + err.message);
parentLogger.write(MODULE_NAME, "[WARN] initialize -> onBotDownloaded -> onCommonsDownloaded -> Commons not found: " + err.message);
callBackFunction(global.DEFAULT_OK_RESPONSE);
return;
}