From 8227a66fd8de095f39199eb1c01682a1bc6fb402 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 15 Apr 2018 10:25:17 +0200 Subject: [PATCH] StatusDependencies --- .vs/AAOlivia-Indicator-Bot/v15/.suo | Bin 32256 -> 35328 bytes Multi-Period-Daily/User.bot.js | 24 ++++++++++++------------ Multi-Period-Market/User.bot.js | 24 ++++++++++++------------ this.bot.config.json | 4 ++-- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.vs/AAOlivia-Indicator-Bot/v15/.suo b/.vs/AAOlivia-Indicator-Bot/v15/.suo index 782f96eaf9a00643284c2bc6a88f36436477f78d..0fc8876450b50c7d08a87deba9ed3e2b2d181420 100644 GIT binary patch delta 2404 zcmcguUrbwN6u;l?E!@HFDF4a^j21>&l|L&C4S%;XN>a#H7!+90Ns-}XbTHXvZj3qR zHXH*LdZsMP{0GMP-~(_;^kK%C;e+}xj6P_L3HnTyEGfyh=;}F_wiE&;CdM!M^`7sX z^PTVf`wk5L$p)|UW7Zv9aOpWtLYhZB@%#P6W-ue{oNeQW~Kg{Hm8Kt%?)u|ik)FpNm zovG0=42|1~AWLx3kQp(A8z;IKnaqr6EnZ9aB@&e`1oTKZ3h8J>Mi?(1wNi8m$k`U) znqXKg)$YMvIeaVb(iI@JFCeoi4@3>~Mu~7VSzrAIa<3wW5!VnSh*89wh_?`LBgPQp z2rmK<*Aed^-bG9x$kQh?hdy9lNoH4|PrAS^!!rI}fyG^7}f(i{{ z5}u=YD0Ws1%lZqf2(@b^sy+#5kq~^b3oy@H6X)g3^|zSNap2Obkz<;!AY# zA|)qyR*~asnNH10WEdNK+n37%pBb4)mmOmf8XDiUW9XA$QSs#o}>#J`5$3y494x4nRQ1O{1p2CU`W5R}EX;33PEReJB!QGrA@L|prRHlEq{$54Syv0DDHz(0$$zk>t zU!KIghDv&yifkBVvuXBFf~d?|dQuC@qur7GY+*+vI}9(C&ajW+qT^EfNv@4+=eqFs z7}vq&avrWn-RE(~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>B<(VR zTa>EJKWIs~j%;rRgX6pL!4pR?m~6z)$NXp-XkbgUlQv>Yg?Gl)fdH|7GyYPXVf^Hm zl}r#Ap&yyjk9%;bzsAiwv1lEO{9}s}5)aOu!BBE1rBRO0pE(Tq zl-sqKqq`jcpQ3a(a21r zC*6VxcifEcuP^)a-BfJ0j=UP}|E_kXp4J)k)A~PF@M(st+Fsmz*$MmcqyM)Onmy_H zVjkbMrg0_P9M*(agfl{u&`F~vJWF^{Xo+;>-}l^aHQ<`6{Qi0ye!Sqt*IC!>1p6Im C8#1N< diff --git a/Multi-Period-Daily/User.bot.js b/Multi-Period-Daily/User.bot.js index beadcdfb5..e60bc70c2 100644 --- a/Multi-Period-Daily/User.bot.js +++ b/Multi-Period-Daily/User.bot.js @@ -37,11 +37,11 @@ let utilities = UTILITIES.newUtilities(bot); - let dependencies; + let statusDependencies; return thisObject; - function initialize(pDependencies, pMonth, pYear, callBackFunction) { + function initialize(pStatusDependencies, pMonth, pYear, callBackFunction) { try { @@ -49,7 +49,7 @@ if (FULL_LOG === true) { logger.write("[INFO] initialize -> Entering function."); } - dependencies = pDependencies; + statusDependencies = pStatusDependencies; commons.initializeStorage(oliviaStorage, bruceStorage, onInizialized); @@ -110,13 +110,13 @@ Read the candles and volumes from Bruce and produce a file for each day and for reportKey = "AAMasters" + "-" + "AACharly" + "-" + "Poloniex-Historic-Trades" + "-" + "dataSet.V1"; if (FULL_LOG === true) { logger.write("[INFO] start -> getContextVariables -> reportKey = " + reportKey); } - if (dependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") { + if (statusDependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") { logger.write("[ERROR] start -> getContextVariables -> Can not continue because dependecy Status Report is corrupt. "); callBackFunction(global.DEFAULT_RETRY_RESPONSE); return; } - thisReport = dependencies.statusReports.get(reportKey).file; + thisReport = statusDependencies.statusReports.get(reportKey).file; if (thisReport.lastFile === undefined) { logger.write("[WARN] start -> getContextVariables -> Undefined Last File. -> reportKey = " + reportKey); @@ -136,13 +136,13 @@ Read the candles and volumes from Bruce and produce a file for each day and for reportKey = "AAMasters" + "-" + "AABruce" + "-" + "One-Min-Daily-Candles-Volumes" + "-" + "dataSet.V1" + "-" + bot.processDatetime.getUTCFullYear() + "-" + utilities.pad(bot.processDatetime.getUTCMonth() + 1,2); if (FULL_LOG === true) { logger.write("[INFO] start -> getContextVariables -> reportKey = " + reportKey); } - if (dependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") { + if (statusDependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") { logger.write("[ERROR] start -> getContextVariables -> Can not continue because dependecy Status Report is corrupt. "); callBackFunction(global.DEFAULT_RETRY_RESPONSE); return; } - thisReport = dependencies.statusReports.get(reportKey).file; + thisReport = statusDependencies.statusReports.get(reportKey).file; if (thisReport.lastFile === undefined) { logger.write("[WARN] start -> getContextVariables -> Undefined Last File. -> reportKey = " + reportKey); @@ -161,13 +161,13 @@ Read the candles and volumes from Bruce and produce a file for each day and for reportKey = "AAMasters" + "-" + "AAOlivia" + "-" + "Multi-Period-Daily" + "-" + "dataSet.V1"; if (FULL_LOG === true) { logger.write("[INFO] start -> getContextVariables -> reportKey = " + reportKey); } - if (dependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") { + if (statusDependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") { logger.write("[ERROR] start -> getContextVariables -> Can not continue because self dependecy Status Report is corrupt. Aborting Process."); callBackFunction(global.DEFAULT_FAIL_RESPONSE); return; } - thisReport = dependencies.statusReports.get(reportKey).file; + thisReport = statusDependencies.statusReports.get(reportKey).file; if (thisReport.lastFile !== undefined) { @@ -195,8 +195,8 @@ Read the candles and volumes from Bruce and produce a file for each day and for } catch (err) { logger.write("[ERROR] start -> getContextVariables -> err = " + err.message); if (err.message === "Cannot read property 'file' of undefined") { - logger.write("[HINT] start -> getContextVariables -> Check the bot configuration to see if all of its dependencies declarations are correct. "); - logger.write("[HINT] start -> getContextVariables -> Dependencies loaded -> keys = " + JSON.stringify(dependencies.keys)); + logger.write("[HINT] start -> getContextVariables -> Check the bot configuration to see if all of its statusDependencies declarations are correct. "); + logger.write("[HINT] start -> getContextVariables -> Dependencies loaded -> keys = " + JSON.stringify(statusDependencies.keys)); } callBackFunction(global.DEFAULT_FAIL_RESPONSE); } @@ -663,7 +663,7 @@ Read the candles and volumes from Bruce and produce a file for each day and for try { let reportKey = "AAMasters" + "-" + "AAOlivia" + "-" + "Multi-Period-Daily" + "-" + "dataSet.V1"; - let thisReport = dependencies.statusReports.get(reportKey); + let thisReport = statusDependencies.statusReports.get(reportKey); thisReport.file.lastExecution = bot.processDatetime; thisReport.file.lastFile = lastFileDate; diff --git a/Multi-Period-Market/User.bot.js b/Multi-Period-Market/User.bot.js index 6bf8d14c3..69bcab502 100644 --- a/Multi-Period-Market/User.bot.js +++ b/Multi-Period-Market/User.bot.js @@ -37,11 +37,11 @@ let utilities = UTILITIES.newUtilities(bot); - let dependencies; + let statusDependencies; return thisObject; - function initialize(pDependencies, pMonth, pYear, callBackFunction) { + function initialize(pStatusDependencies, pMonth, pYear, callBackFunction) { try { @@ -49,7 +49,7 @@ if (FULL_LOG === true) { logger.write("[INFO] initialize -> Entering function."); } - dependencies = pDependencies; + statusDependencies = pStatusDependencies; commons.initializeStorage(oliviaStorage, bruceStorage, onInizialized); @@ -110,13 +110,13 @@ Read the candles and volumes from Bruce and produce a single Index File for Mark reportKey = "AAMasters" + "-" + "AACharly" + "-" + "Poloniex-Historic-Trades" + "-" + "dataSet.V1"; if (FULL_LOG === true) { logger.write("[INFO] start -> getContextVariables -> reportKey = " + reportKey); } - if (dependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") { + if (statusDependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") { logger.write("[ERROR] start -> getContextVariables -> Can not continue because dependecy Status Report is corrupt. "); callBackFunction(global.DEFAULT_RETRY_RESPONSE); return; } - thisReport = dependencies.statusReports.get(reportKey).file; + thisReport = statusDependencies.statusReports.get(reportKey).file; if (thisReport.lastFile === undefined) { logger.write("[WARN] start -> getContextVariables -> Undefined Last File. -> reportKey = " + reportKey); @@ -136,13 +136,13 @@ Read the candles and volumes from Bruce and produce a single Index File for Mark reportKey = "AAMasters" + "-" + "AABruce" + "-" + "One-Min-Daily-Candles-Volumes" + "-" + "dataSet.V1" + "-" + bot.processDatetime.getUTCFullYear() + "-" + utilities.pad(bot.processDatetime.getUTCMonth() + 1,2); if (FULL_LOG === true) { logger.write("[INFO] start -> getContextVariables -> reportKey = " + reportKey); } - if (dependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") { + if (statusDependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") { logger.write("[ERROR] start -> getContextVariables -> Can not continue because dependecy Status Report is corrupt. "); callBackFunction(global.DEFAULT_RETRY_RESPONSE); return; } - thisReport = dependencies.statusReports.get(reportKey).file; + thisReport = statusDependencies.statusReports.get(reportKey).file; if (thisReport.lastFile === undefined) { logger.write("[ERROR] start -> getContextVariables -> Undefined Last File. -> reportKey = " + reportKey); @@ -161,13 +161,13 @@ Read the candles and volumes from Bruce and produce a single Index File for Mark reportKey = "AAMasters" + "-" + "AAOlivia" + "-" + "Multi-Period-Market" + "-" + "dataSet.V1"; if (FULL_LOG === true) { logger.write("[INFO] start -> getContextVariables -> reportKey = " + reportKey); } - if (dependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") { + if (statusDependencies.statusReports.get(reportKey).status === "Status Report is corrupt.") { logger.write("[ERROR] start -> getContextVariables -> Can not continue because self dependecy Status Report is corrupt. Aborting Process."); callBackFunction(global.DEFAULT_FAIL_RESPONSE); return; } - thisReport = dependencies.statusReports.get(reportKey).file; + thisReport = statusDependencies.statusReports.get(reportKey).file; if (thisReport.lastFile !== undefined) { @@ -195,8 +195,8 @@ Read the candles and volumes from Bruce and produce a single Index File for Mark } catch (err) { logger.write("[ERROR] start -> getContextVariables -> err = " + err.message); if (err.message === "Cannot read property 'file' of undefined") { - logger.write("[HINT] start -> getContextVariables -> Check the bot configuration to see if all of its dependencies declarations are correct. "); - logger.write("[HINT] start -> getContextVariables -> Dependencies loaded -> keys = " + JSON.stringify(dependencies.keys)); + logger.write("[HINT] start -> getContextVariables -> Check the bot configuration to see if all of its statusDependencies declarations are correct. "); + logger.write("[HINT] start -> getContextVariables -> Dependencies loaded -> keys = " + JSON.stringify(statusDependencies.keys)); logger.write("[HINT] start -> getContextVariables -> Dependencies loaded -> Double check that you are not running a process that only can be run at noTime mode at a certain month when it is not prepared to do so."); } callBackFunction(global.DEFAULT_FAIL_RESPONSE); @@ -851,7 +851,7 @@ Read the candles and volumes from Bruce and produce a single Index File for Mark try { let reportKey = "AAMasters" + "-" + "AAOlivia" + "-" + "Multi-Period-Market" + "-" + "dataSet.V1"; - let thisReport = dependencies.statusReports.get(reportKey); + let thisReport = statusDependencies.statusReports.get(reportKey); thisReport.file.lastExecution = bot.processDatetime; thisReport.file.lastFile = lastFileDate; diff --git a/this.bot.config.json b/this.bot.config.json index c2c27cf6e..2e2901d87 100644 --- a/this.bot.config.json +++ b/this.bot.config.json @@ -32,7 +32,7 @@ "retryWaitTime": 10000, "sleepWaitTime": 3600000, "comaWaitTime": 86400000, - "dependencies": [ + "statusDependencies": [ { "devTeam": "AAMasters", "bot": "AACharly", @@ -88,7 +88,7 @@ "retryWaitTime": 10000, "sleepWaitTime": 3600000, "comaWaitTime": 86400000, - "dependencies": [ + "statusDependencies": [ { "devTeam": "AAMasters", "bot": "AACharly",