SESSION.folderName implemented

This commit is contained in:
Luis Fernando Molina committed 2019-10-17 10:20:48 +02:00
1 parent b3d5c293f5
commit dba159af7a
5 files changed
+28 -10

No files matched your search

+1 -1
View File
@@ -84,7 +84,7 @@
statusDependencies = pStatusDependencies;
if (bot.SESSION !== undefined) {
sessionPath = bot.SESSION.id + "/"
sessionPath = bot.SESSION.folderName + "/"
}
/*
+1 -5
View File
@@ -69,11 +69,7 @@ exports.newDebugLog = function newDebugLog() {
let filePath = thisObject.bot.filePathRoot + "/Logs/" + thisObject.bot.process + "/"
if (thisObject.bot.SESSION !== undefined) {
if (thisObject.bot.SESSION.code.folderName === undefined) {
filePath = filePath + thisObject.bot.SESSION.id + "/" + executionDatetime;
} else {
filePath = filePath + thisObject.bot.SESSION.code.folderName + "/" + executionDatetime;
}
filePath = filePath + thisObject.bot.SESSION.folderName + "/" + executionDatetime;
} else {
filePath = filePath + executionDatetime;
}
+1 -1
View File
@@ -986,7 +986,7 @@
let fileContent = JSON.stringify(dataRange);
let fileName = '/Data.Range.' + market.assetA + '_' + market.assetB + '.json';
let filePath = bot.filePathRoot + "/Output/" + bot.SESSION.id + "/" + pProductFolder + "/" + 'Multi-Period-Daily' + fileName;
let filePath = bot.filePathRoot + "/Output/" + bot.SESSION.folderName + "/" + pProductFolder + "/" + 'Multi-Period-Daily' + fileName;
fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
+24 -2
View File
@@ -14,12 +14,19 @@
if (FULL_LOG === true) { parentLogger.write(MODULE_NAME, "[INFO] initialize -> Entering function."); }
/* Initialize this info so that everything is logged propeerly */
bot.SESSION = {
name: bot.processNode.session.name,
id: bot.processNode.session.id,
code: bot.processNode.session.code
id: bot.processNode.session.id
}
/* Set the folderName for early logging */
if (bot.processNode.session.code.folderName === undefined) {
bot.SESSION.folderName = bot.SESSION.id
} else {
bot.SESSION.folderName = bot.processNode.session.code.folderName
}
/* Check if there is a session */
if (bot.processNode.session === undefined) {
parentLogger.write(MODULE_NAME, "[ERROR] initialize -> Cannot run without a Session.");
@@ -40,6 +47,21 @@
bot.SESSION = JSON.parse(message.event.session)
bot.UI_CURRENT_VALUES = message.event.uiCurrentValues
/* Set the folderName for logging, reports, context and data output */
let code
if (bot.SESSION.code !== undefined) {
try {
code = JSON.parse(bot.SESSION.code)
if (code.folderName === undefined) {
bot.SESSION.folderName = bot.SESSION.id
} else {
bot.SESSION.folderName = bot.processNode.session.code.folderName
}
} catch (err) {
bot.SESSION.folderName = bot.SESSION.id
}
}
setValuesToUse(message)
switch (bot.SESSION.type) {
+1 -1
View File
@@ -51,7 +51,7 @@
year = pYear;
if (bot.SESSION !== undefined && pOwner.type === "Trading Engine") {
sessionPath = bot.SESSION.id + "/"
sessionPath = bot.SESSION.folderName + "/"
}
if (owner.dataSetSection === "Month") {