Bug Fixed and ,ENV removed

This commit is contained in:
Luis Fernando Molina committed 2020-11-29 20:26:45 +01:00
1 parent b344f1fed9
commit eb04de1781
17 files changed
+122 -170

No files matched your search

-12
View File
@@ -1,12 +0,0 @@
exports.newEnvironment = function () {
let thisObject = {
WEB_SOCKETS_INTERFACE_PORT: 18041,
STORAGE_PATH: './Data-Storage',
PROJECTS_PATH: './Projects',
LOG_PATH: './Log-Files',
PROJECTS_REQUIRED_PATH: '../Projects'
}
return thisObject;
}
+6 -6
View File
@@ -74,10 +74,10 @@ exports.newFileStorage = function newFileStorage(logger, host, port) {
let fileLocation
let mustBeJason
if (filePath.indexOf("/bots/") > 0) {
fileLocation = global.env.PROJECTS_PATH + '/' + filePath
fileLocation = global.env.PATH_TO_PROJECTS + '/' + filePath
mustBeJason = false
} else {
fileLocation = global.env.STORAGE_PATH + '/' + filePath
fileLocation = global.env.PATH_TO_DATA_STORAGE + '/' + filePath
mustBeJason = true
}
@@ -234,9 +234,9 @@ exports.newFileStorage = function newFileStorage(logger, host, port) {
/* Choose path for either logs or data */
let fileLocation
if (filePath.indexOf("/Logs/") > 0) {
fileLocation = global.env.LOG_PATH + '/' + filePath
fileLocation = global.env.PATH_TO_LOG_FILES + '/' + filePath
} else {
fileLocation = global.env.STORAGE_PATH + '/' + filePath
fileLocation = global.env.PATH_TO_DATA_STORAGE + '/' + filePath
}
try {
@@ -391,9 +391,9 @@ exports.newFileStorage = function newFileStorage(logger, host, port) {
/* Choose path for either logs or data */
let fileLocation
if (filePath.indexOf("/Logs/") > 0) {
fileLocation = global.env.LOG_PATH + '/' + filePath
fileLocation = global.env.PATH_TO_LOG_FILES + '/' + filePath
} else {
fileLocation = global.env.STORAGE_PATH + '/' + filePath
fileLocation = global.env.PATH_TO_DATA_STORAGE + '/' + filePath
}
try {
+1 -1
View File
@@ -165,7 +165,7 @@ exports.newLearningSession = function (processIndex, bot, parentLogger) {
socialBotsModule.finalize()
bot.STOP_SESSION = true
parentLogger.write(MODULE_NAME, '[IMPORTANT] stopSession -> Stopping the Session now. ')
sessionInfo(processIndex, bot.LEARNING_SESSION, commandOrigin, parentLogger)
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionInfo(processIndex, bot.LEARNING_SESSION, commandOrigin, parentLogger)
}
function setUpSessionFolderName() {
+12 -3
View File
@@ -24,11 +24,20 @@
tradingSystem = bot.simulationState.tradingSystem
exchangeId = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name.toLowerCase()
let key
let secret
if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.keyReference !== undefined) {
if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.keyReference.referenceParent !== undefined) {
key = TS.projects.superalgos.globals.taskConstants.TASK_NODE.keyReference.referenceParent.config.codeName
secret = TS.projects.superalgos.globals.taskConstants.TASK_NODE.keyReference.referenceParent.config.secret
}
}
const exchangeClass = ccxt[exchangeId]
const exchangeConstructorParams = {
'apiKey': TS.projects.superalgos.globals.taskConstants.TASK_NODE.keyReference.referenceParent.config.codeName,
'secret': TS.projects.superalgos.globals.taskConstants.TASK_NODE.keyReference.referenceParent.config.secret,
'apiKey': key,
'secret': secret,
'timeout': 30000,
'enableRateLimit': true,
verbose: false,
+4 -4
View File
@@ -27,7 +27,7 @@ exports.newMultiProject = function () {
if (projectDefinition.TS.utilities !== undefined) {
for (let j = 0; j < projectDefinition.TS.utilities.length; j++) {
let utilityDefinition = projectDefinition.TS.utilities[j]
let path = global.env.PROJECTS_REQUIRED_PATH + '/' + projectDefinition.name + '/' + 'TS' + '/' + 'Utilities' + '/' + utilityDefinition.fileName
let path = global.env.PATH_TO_PROJECTS_REQUIRED + '/' + projectDefinition.name + '/' + 'TS' + '/' + 'Utilities' + '/' + utilityDefinition.fileName
let requiredObject = require(path)
let requiredFunction = requiredObject[utilityDefinition.functionName]
@@ -39,7 +39,7 @@ exports.newMultiProject = function () {
if (projectDefinition.TS.globals !== undefined) {
for (let j = 0; j < projectDefinition.TS.globals.length; j++) {
let globalDefinition = projectDefinition.TS.globals[j]
let path = global.env.PROJECTS_REQUIRED_PATH + '/' + projectDefinition.name + '/' + 'TS' + '/' + 'Globals' + '/' + globalDefinition.fileName
let path = global.env.PATH_TO_PROJECTS_REQUIRED + '/' + projectDefinition.name + '/' + 'TS' + '/' + 'Globals' + '/' + globalDefinition.fileName
let requiredObject = require(path)
let requiredFunction = requiredObject[globalDefinition.functionName]
@@ -51,7 +51,7 @@ exports.newMultiProject = function () {
if (projectDefinition.TS.functionLibraries !== undefined) {
for (let j = 0; j < projectDefinition.TS.functionLibraries.length; j++) {
let functionLibraryDefinition = projectDefinition.TS.functionLibraries[j]
let path = global.env.PROJECTS_REQUIRED_PATH + '/' + projectDefinition.name + '/' + 'TS' + '/' + 'Function-Libraries' + '/' + functionLibraryDefinition.fileName
let path = global.env.PATH_TO_PROJECTS_REQUIRED + '/' + projectDefinition.name + '/' + 'TS' + '/' + 'Function-Libraries' + '/' + functionLibraryDefinition.fileName
let requiredObject = require(path)
let requiredFunction = requiredObject[functionLibraryDefinition.functionName]
@@ -63,7 +63,7 @@ exports.newMultiProject = function () {
if (projectDefinition.TS.botClasses !== undefined) {
for (let j = 0; j < projectDefinition.TS.botClasses.length; j++) {
let botClassDefinition = projectDefinition.TS.botClasses[j]
let path = global.env.PROJECTS_REQUIRED_PATH + '/' + projectDefinition.name + '/' + 'TS' + '/' + 'Bot-Classes' + '/' + botClassDefinition.fileName
let path = global.env.PATH_TO_PROJECTS_REQUIRED + '/' + projectDefinition.name + '/' + 'TS' + '/' + 'Bot-Classes' + '/' + botClassDefinition.fileName
let requiredObject = require(path)
let requiredFunction = requiredObject[botClassDefinition.functionName]
+4 -4
View File
@@ -1,5 +1,5 @@
/* Load Environment Variables */
let ENVIRONMENT = require('./Environment.js');
let ENVIRONMENT = require('../Environment.js');
let ENVIRONMENT_MODULE = ENVIRONMENT.newEnvironment()
global.env = ENVIRONMENT_MODULE
@@ -52,9 +52,9 @@ function preLoader() {
But before that, we need to change the path of these env variables since the home
directory now is TaskServer and not its parent.
*/
global.env.STORAGE_PATH = '.' + global.env.STORAGE_PATH
global.env.PROJECTS_PATH = '.' + global.env.PROJECTS_PATH
global.env.LOG_PATH = '.' + global.env.LOG_PATH
global.env.PATH_TO_DATA_STORAGE = '.' + global.env.PATH_TO_DATA_STORAGE
global.env.PATH_TO_PROJECTS = '.' + global.env.PATH_TO_PROJECTS
global.env.PATH_TO_LOG_FILES = '.' + global.env.PATH_TO_LOG_FILES
try {
global.EVENT_SERVER_CLIENT_MODULE.listenToEvent('Task Server', 'Debug Task Started', undefined, 'Task Server', undefined, startDebugging)
+1 -1
View File
@@ -166,7 +166,7 @@
socialBotsModule.finalize()
bot.STOP_SESSION = true
parentLogger.write(MODULE_NAME, '[IMPORTANT] stopSession -> Stopping the Session now. ')
sessionInfo(processIndex, bot.TRADING_SESSION, commandOrigin, parentLogger)
TS.projects.superalgos.functionLibraries.sessionFunctions.sessionInfo(processIndex, bot.TRADING_SESSION, commandOrigin, parentLogger)
}
function setUpSessionFolderName() {