Merge pull request #121 from AAVikings/master

Reordering sequence
This commit is contained in:
benme authored and GitHub committed 2019-08-08 07:10:27 -03:00
commit 4c94742e5f
3 files changed
+200 -28

No files matched your search

+14 -14
View File
@@ -58,7 +58,7 @@
usertBot.initialize(dataDependencies, callBackFunction);
} catch (err) {
logger.write(MODULE_NAME, "[ERROR] initialize -> err = "+ err);
logger.write(MODULE_NAME, "[ERROR] initialize -> err = ", err);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
}
}
@@ -124,7 +124,7 @@
}
catch (err) {
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoop -> err = "+ err);
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoop -> err = ", err);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
}
}
@@ -183,7 +183,7 @@
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> dependencyLoopBody -> getFile -> onFileReceived -> err = "+ err);
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> dependencyLoopBody -> getFile -> onFileReceived -> err = ", err);
callBackFunction(err);
return;
}
@@ -195,20 +195,20 @@
}
catch (err) {
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> dependencyLoopBody -> getFile -> onFileReceived -> err = "+ err);
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> dependencyLoopBody -> getFile -> onFileReceived -> err = ", err);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
}
}
}
catch (err) {
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> dependencyLoopBody -> getFile -> err = "+ err);
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> dependencyLoopBody -> getFile -> err = ", err);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
}
}
}
catch (err) {
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoop -> dependencyLoopBody -> err = "+ err);
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoop -> dependencyLoopBody -> err = ", err);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
}
}
@@ -232,7 +232,7 @@
}
}
catch (err) {
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> dependencyControlLoop -> err = "+ err);
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> dependencyControlLoop -> err = ", err);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
}
}
@@ -269,19 +269,19 @@
periodsControlLoop();
}
catch (err) {
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> callTheBot -> onBotFinished -> err = "+ err);
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> callTheBot -> onBotFinished -> err = ", err);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
}
}
}
catch(err){
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> callTheBot -> err = "+ err);
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> callTheBot -> err = ", err);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
}
}
}
catch (err) {
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> err = "+ err);
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsLoopBody -> err = ", err);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
}
}
@@ -305,14 +305,14 @@
}
}
catch (err) {
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsControlLoop -> err = "+ err);
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> periodsControlLoop -> err = ", err);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
}
}
}
catch (err) {
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> err = "+ err);
logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriods -> err = ", err);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
}
}
@@ -331,14 +331,14 @@
}
catch (err) {
logger.write(MODULE_NAME, "[ERROR] start -> writeStatusReport -> err = "+ err);
logger.write(MODULE_NAME, "[ERROR] start -> writeStatusReport -> err = ", err);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
}
}
}
catch (err) {
logger.write(MODULE_NAME, "[ERROR] start -> err = "+ err);
logger.write(MODULE_NAME, "[ERROR] start -> err = ", err);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
}
}
+19 -14
View File
@@ -12,7 +12,7 @@ global.CLONE_EXECUTOR = { codeName: 'AACloud', version: '1.1' };
process.on('uncaughtException', function (err) {
console.log('[INFO] Run -> uncaughtException -> err.message = ' + err.message);
console.log('[INFO] Run -> uncaughtException -> err.stack = '+ err.stack);
console.log('[INFO] Run -> uncaughtException -> err.stack = ' + err.stack);
process.exit(1)
});
@@ -29,6 +29,7 @@ process.on('exit', function (code) {
let isRunSequence = false;
let sequenceStep = 0;
let loopCount = 0;
let processedSteps = new Map()
if (process.env.RUN_SEQUENCE !== undefined) {
isRunSequence = JSON.parse(process.env.RUN_SEQUENCE)
@@ -43,19 +44,22 @@ if (isRunSequence) {
function sequenceExecution(currentStep) {
let execution = sequenceList[currentStep];
process.env.STOP_GRACEFULLY = true;
process.env.DEV_TEAM = execution.devTeam;
process.env.BOT = execution.bot;
process.env.START_MODE = execution.mode;
process.env.RESUME_EXECUTION = execution.resumeExecution;
process.env.TYPE = execution.type;
process.env.PROCESS = execution.process;
process.env.MIN_YEAR = execution.startYear;
process.env.MAX_YEAR = execution.endYear;
process.env.MONTH = execution.month;
process.env.BEGIN_DATE_TIME = execution.beginDatetime;
process.env.TIME_PERIOD = execution.timePeriod;
execution.devTeam ? process.env.DEV_TEAM = execution.devTeam : undefined;
execution.bot ? process.env.BOT = execution.bot : undefined;
execution.mode ? process.env.START_MODE = execution.mode : undefined;
execution.resumeExecution ? process.env.RESUME_EXECUTION = execution.resumeExecution : undefined;
execution.type ? process.env.TYPE = execution.type : undefined;
execution.process ? process.env.PROCESS = execution.process : undefined;
execution.startYear ? process.env.MIN_YEAR = execution.startYear : undefined;
execution.endYear ? process.env.MAX_YEAR = execution.endYear : undefined;
execution.month ? process.env.MONTH = execution.month : undefined;
execution.beginDatetime ? process.env.BEGIN_DATE_TIME = execution.beginDatetime : undefined;
execution.dataSet ? process.env.DATA_SET = execution.dataSet : undefined;
process.env.CLONE_ID = 1;
global.EXCHANGE_NAME = execution.exchangeName;
execution.timePeriod ? process.env.TIME_PERIOD = execution.timePeriod : undefined;
execution.exchangeName ? global.EXCHANGE_NAME = execution.exchangeName : undefined;
// global.FULL_LOG = execution.fullLog;
let stepKey = execution.devTeam + '.' + execution.bot + '.' + execution.process;
@@ -79,6 +83,7 @@ function onExecutionFinish(result, finishStepKey) {
} else {
setTimeout(function () {
console.log("[INFO] onExecutionFinish -> New round for sequence execution started.");
loopCount++;
sequenceStep = 0;
processedSteps = new Map();
sequenceExecution(sequenceStep);
@@ -180,7 +185,7 @@ function readExecutionConfiguration() {
}
catch (err) {
console.log("[ERROR] readExecutionConfiguration -> err = "+ err);
console.log("[ERROR] readExecutionConfiguration -> err = " + err);
console.log("[ERROR] readExecutionConfiguration -> Please verify that the Start Mode for the type of Bot configured applies to that type.");
console.log("[ERROR] readExecutionConfiguration -> err = " + err.stack);
}
+167
View File
@@ -1,5 +1,113 @@
[
{
"devTeam": "AAMasters",
"bot": "AACharly",
"mode": "noTime",
"resumeExecution": true,
"type": "Sensor",
"exchangeName": "Poloniex",
"process": "Live-Trades",
"startYear": 2019,
"endYear": 2021,
"month": 1
},
{
"devTeam": "AAMasters",
"bot": "AACharly",
"mode": "noTime",
"resumeExecution": true,
"type": "Sensor",
"exchangeName": "Poloniex",
"process": "Hole-Fixing",
"startYear": 2019,
"endYear": 2021,
"month": 1
},
{
"devTeam": "AAMasters",
"bot": "AABruce",
"mode": "noTime",
"resumeExecution": true,
"type": "Indicator",
"exchangeName": "Poloniex",
"process": "Single-Period-Daily",
"startYear": 2019,
"endYear": 2021,
"month": 1
},
{
"devTeam": "AAMasters",
"bot": "AAOlivia",
"mode": "noTime",
"resumeExecution": true,
"type": "Indicator",
"exchangeName": "Poloniex",
"process": "Multi-Period-Daily",
"startYear": 2019,
"endYear": 2021,
"month": 1
},
{
"devTeam": "AAMasters",
"bot": "AAOlivia",
"mode": "noTime",
"resumeExecution": true,
"type": "Indicator",
"exchangeName": "Poloniex",
"process": "Multi-Period-Market",
"startYear": 2019,
"endYear": 2021,
"month": 1
},
{
"devTeam": "AAMasters",
"bot": "AATom",
"mode": "noTime",
"resumeExecution": true,
"type": "Indicator",
"exchangeName": "Poloniex",
"process": "Multi-Period-Daily",
"startYear": 2019,
"endYear": 2021,
"month": 1
},
{
"devTeam": "AAMasters",
"bot": "AATom",
"mode": "noTime",
"resumeExecution": true,
"type": "Indicator",
"exchangeName": "Poloniex",
"process": "Multi-Period-Market",
"startYear": 2019,
"endYear": 2021,
"month": 1
},
{
"devTeam": "AAMasters",
"bot": "AAChris",
"mode": "noTime",
"resumeExecution": true,
"type": "Indicator",
"exchangeName": "Poloniex",
"process": "Multi-Period-Daily",
"startYear": 2019,
"endYear": 2021,
"month": 1
},
{
"devTeam": "AAMasters",
"bot": "AAChris",
"mode": "noTime",
"resumeExecution": true,
"type": "Indicator",
"exchangeName": "Poloniex",
"process": "Multi-Period-Market",
"startYear": 2019,
"endYear": 2021,
"month": 1
},
{
"devTeam": "AAMasters",
"bot": "AAPaula",
@@ -11,5 +119,64 @@
"startYear": 2019,
"endYear": 2021,
"month": 1
},
{
"devTeam": "AAMasters",
"bot": "AAPaula",
"mode": "noTime",
"resumeExecution": true,
"type": "Indicator",
"exchangeName": "Poloniex",
"process": "Multi-Period-Market",
"startYear": 2019,
"endYear": 2021,
"month": 1
},
{
"devTeam": "AAVikings",
"bot": "AAGauss",
"mode": "noTime",
"resumeExecution": true,
"type": "Indicator",
"exchangeName": "Poloniex",
"process": "Multi-Period-Daily",
"startYear": 2019,
"endYear": 2021,
"month": 1
},
{
"devTeam": "AAVikings",
"bot": "AAGauss",
"mode": "noTime",
"resumeExecution": true,
"type": "Indicator",
"exchangeName": "Poloniex",
"process": "Multi-Period-Market",
"startYear": 2019,
"endYear": 2021,
"month": 1
},
{
"devTeam": "vikingsalerts",
"bot": "simulator-bot-vikingsalerts",
"mode": "noTime",
"resumeExecution": true,
"type": "Indicator",
"exchangeName": "Poloniex",
"process": "Multi-Period-Daily",
"beginDatetime": "2019-08-01T08:00:00.000Z",
"timePeriod": "05-min"
},
{
"devTeam": "vikingsalerts",
"bot": "bot-vikingsalerts",
"mode": "live",
"resumeExecution": true,
"type": "Trading",
"exchangeName": "Poloniex",
"process": "Trading-Process",
"beginDatetime": "2019-08-01T08:00:00.000Z",
"timePeriod": "05-min",
"dataSet": "Multi-Period-Daily"
}
]