Merge pull request #51 from AAVikings/master

Moving to paramaters to bot config
This commit is contained in:
benme authored and GitHub committed 2019-03-22 19:20:26 +01:00
commit 3f7eda858b
2 files changed
+10 -6

No files matched your search

+4 -2
View File
@@ -345,8 +345,8 @@
switch (global.CURRENT_EXECUTION_AT) {
case "Cloud": {
processConfig.startMode = global.EXECUTION_CONFIG.startMode // Override file storage configuration
if(global.TIME_PERIOD){
processConfig.timePeriod = global.TIME_PERIOD
if(global.EXECUTION_CONFIG.timePeriod){
processConfig.timePeriod = global.EXECUTION_CONFIG.timePeriod
}
break;
}
@@ -865,6 +865,8 @@
logger = DEBUG_MODULE.newDebugLog();
logger.bot = pBotConfig;
pBotConfig.timePeriodFileStorage = global.EXECUTION_CONFIG.timePeriodFileStorage
pBotConfig.dataSet = global.EXECUTION_CONFIG.dataSet
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> findProcess -> runTradingBot -> createBotInstance -> Entering function."); }
+6 -4
View File
@@ -123,7 +123,9 @@ function readExecutionConfiguration() {
global.EXECUTION_CONFIG = {
executionList: executionList,
startMode: startMode,
timePeriod: getTimePeriod()
timePeriod: getTimePeriod(process.env.TIME_PERIOD),
timePeriodFileStorage: process.env.TIME_PERIOD,
dataSet: process.env.DATA_SET
};
readStoragePermissions();
@@ -136,8 +138,8 @@ function readExecutionConfiguration() {
}
}
function getTimePeriod(){
if(process.env.TIME_PERIOD !== undefined){
function getTimePeriod(timePeriod){
if(timePeriod !== undefined){
try {
let timePeriodMap = new Map()
timePeriodMap.set("24-hs", 86400000)
@@ -159,7 +161,7 @@ function getTimePeriod(){
timePeriodMap.set("03-min", 180000)
timePeriodMap.set("02-min", 120000)
timePeriodMap.set("01-min", 60000)
return timePeriodMap.get(process.env.TIME_PERIOD)
return timePeriodMap.get(timePeriod)
} catch (error) {
console.log( "[WARN] Run -> readExecutionConfiguration -> getTimePeriod -> Error: ", error);
}