From 7064de6e01f25a63b918a7c681ee8f2ba7b8e7f7 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 19 Mar 2018 15:48:34 +0100 Subject: [PATCH] Hole Fixing Partially debuged --- .vs/AACloud/v15/.suo | Bin 86016 -> 90624 bytes Dependencies.js | 39 +++++++++++++++++++++------------------ Run.js | 6 ++++++ Status Report.js | 5 ++--- this.config.json | 9 ++++++++- 5 files changed, 37 insertions(+), 22 deletions(-) diff --git a/.vs/AACloud/v15/.suo b/.vs/AACloud/v15/.suo index 3f51af9d3d903a0ef45e21b450e8a4a4044b1f6f..03ebdec95ae90befcfd42fc2ba003c43ff2cd1d3 100644 GIT binary patch delta 5237 zcmeHKdr*|u760zH`@t@(%F1I`!MGwmcr5O+R35%|*=6GsF``Aq3@aiMku~gMP!|Pl zYHFGYdoq$qItkr@)TEFApHnsQv7L1~Nym&~I!)5*AY?K&rq(7AJC#=KIs2eQ#Y`Ii zNTqONd+*tM&-vYRFAc3i!#SaAInSgpjh`ytAvL|&boO^F8*2Fi@G14Yj=|sf z0@)obi#d*i)}(2m<0GL?;u=?uihhP4EMdT;s!6d}TZD)~Bq0(Ii3m05r7EoqYh-9T z%87_ch)BdZ#4N;a1ocZ%TA)_CI%f~oR6(r)r2?@4F)ygoqcjHV3sL4Gw1_FdglPYw z$sQyK#@KbiVH<+71Z5mNDHxh}$e=?|%WF{KK-9wff+}Gc=gG147GfWQ>}*5XfN=B6 zS-9U{g;zQ@kiUvX{55xMet9~&?w8ABw#HIF%zLg)FWu58G2>WrUGn{b4WwxM>~gfR_vRK$O(=KM_CxGQ~z+Y zEjl?L6-yAA!H(4^DH>~o?c$)E0yg;~XjRFW6JD3k8n-j3k3%VMUZs*XV}&*k|CAq7 z(k{P-X4|V!8rkZO=t|Zio6-@~uS2OvWCYuH%{l0wGtnZW>eDK+W(l7b&L0?ukp} z9M0v4l%Y<34#sEVUOt_{&gcT!cu=KhGS zfL-&Jf;m+$Y{IS>@m4fQ(l%q2m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9ZpT(N>T$D*>y6^Yp+K$tC2g)d2Br0sjczE>;Ox8L~vjHN+L@AC@^j zN$oYG2EBn2*6SlpTn-!*V?FyGv&I?y9W2#u>kW+_IOv#RYpFdkjar!<^q&;I0xHV;wj%(5~Y%T3`WN6LUm(s4|PuDbT%&?A( zN|7G)?!sryYFPRmO>4xv@Q-vR52te{P4$0g-2W!o{GG9`gq=fY*j&Y21*y2zOu>hw z2Ckw(j!zKO{wzsS#ppBe#B>-%#dT5QFT_ua+T*$+4edP7XlW?2prtxCoZqyIydnto zga(3wxz$jx$v@3C3M{x7+520A;Os zixw=QMdluEg^RfHivo{F^fXCmZ%I^&m*HnE&tO+eI@P~z@JDM1zAMh{kYSqgrI%8x z+K*HNZhSDueKZjkdX9>LTAD$BK`-Fd6RR+|+l1S0Cac#@PX%ye#|hg*da$r_23|fn zOMT$I4(fqZGXcLk8$5iLMlZOA+1(Mpa1_4QPm)h8mmA|dSMfp^^4;+WzIFYLhq<{L z>BXgO+0ighLPO`8)(f`{4@pK3Qsw`bOqP$4KZIYG;-Vj-G30DJ=A5qQ?SsOhVn|OQ z9{VjBSNBI^+|9*m_ALwGw*%wx>l4MkDamcdSlA@0hR)w5-0^cX?(XbtyFMQ7Y2p%w zwoOlmmoKa+0-yF80yn((eczrWu&efCbsD!l2~x}%bh9~xne=qgkF9NL_K})Lxdo>R zeFHE`etnssl(gAji2VhRQxpCKY6NE+Oa#L?SnVzifT!EyRzR1GUHN5$u!)j#w{GM? w6?)T#-n(91@s+^A_o3rdB4;|VwzeiU-Iba#dlq_olhJWD@@Nhi;eT8GF9M*0EC2ui diff --git a/Dependencies.js b/Dependencies.js index 214b3fe5a..3962056f6 100644 --- a/Dependencies.js +++ b/Dependencies.js @@ -7,15 +7,14 @@ let thisObject = { statusReports: new Map(), - initialize: initialize + initialize: initialize, + key: [] }; /* - During the process we will create a new History Record. This will go to the Context History file which essentially mantains an index of all the bots executions. This file will later be plotted by the bot s plotter on the timeline, allowing end users to know where there is information related to the actions taken by the bot. - */ let bot = BOT; @@ -52,11 +51,8 @@ if (err.result !== global.DEFAULT_OK_RESPONSE.result) { logger.write("[ERROR] initialize -> onInitilized -> err = " + err.message); - if (alreadyCalledBack === false) { - callBackFunction(err); - } else { - alreadyCalledBack = true; - } + alreadyCalledBack = true; + callBackFunction(err); return; } @@ -69,29 +65,31 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] initialize -> onLoad -> Execution finished well -> bot = " + pDependenciesConfig[i].bot); + logger.write("[INFO] initialize -> onLoad -> Execution finished well. -> bot = " + pDependenciesConfig[i].bot); + logger.write("[INFO] initialize -> onLoad -> Execution finished well. -> process = " + pDependenciesConfig[i].process); addReport(); return; } case global.CUSTOM_OK_RESPONSE.result: { // We need to see if we can handle this. - logger.write("[ERROR] initialize -> onLoad -> err.message = " + err.message); if (err.message === "Status Report was never created.") { - logger.write("[ERROR] initialize -> onLoad -> err.message = " + err.message); - logger.write("[ERROR] initialize -> onLoad -> Report Not Found. -> bot = " + pDependenciesConfig[i].bot); + logger.write("[WARN] initialize -> onLoad -> err.message = " + err.message); + logger.write("[WARN] initialize -> onLoad -> Report Not Found. -> bot = " + pDependenciesConfig[i].bot); + logger.write("[WARN] initialize -> onLoad -> Report Not Found. -> process = " + pDependenciesConfig[i].process); addReport(); return; } else { - logger.write("[WARN] initialize -> onLoad -> Response not understood."); + logger.write("[ERROR] initialize -> onLoad -> Response not understood. -> err.message = " + err.message); + logger.write("[ERROR] initialize -> onLoad -> Response not understood. -> bot = " + pDependenciesConfig[i].bot); + logger.write("[ERROR] initialize -> onLoad -> Response not understood. -> process = " + pDependenciesConfig[i].process); if (alreadyCalledBack === false) { - callBackFunction(err); - } else { alreadyCalledBack = true; - } + callBackFunction(err); + } return; } } @@ -100,9 +98,8 @@ logger.write("[ERROR] initialize -> onLoad -> Operation Failed."); if (alreadyCalledBack === false) { - callBackFunction(err); - } else { alreadyCalledBack = true; + callBackFunction(err); } return; } @@ -116,6 +113,8 @@ function addReport() { + if (FULL_LOG === true) { logger.write("[INFO] initialize -> addReport -> Entering function."); } + loadCount++; let key; @@ -126,11 +125,15 @@ key = pDependenciesConfig[i].devTeam + "-" + pDependenciesConfig[i].bot + "-" + pDependenciesConfig[i].process + "-" + pDependenciesConfig[i].dataSetVersion; } + thisObject.key.push(key); thisObject.statusReports.set(key, statusReportModule); + if (FULL_LOG === true) { logger.write("[INFO] initialize -> addReport -> Report added to Map. -> key = " + key); } + if (loadCount === pDependenciesConfig.length) { if (alreadyCalledBack === false) { callBackFunction(global.DEFAULT_OK_RESPONSE); + return; } } } diff --git a/Run.js b/Run.js index b3c17c8c7..a880348a7 100644 --- a/Run.js +++ b/Run.js @@ -139,6 +139,12 @@ for (let p = 0; p < global.PLATFORM_CONFIG.executionList.length; p++) { let listItem = PLATFORM_CONFIG.executionList[p]; + if (listItem.enabled !== "true") { + + console.log("[INFO] Skipping process " + listItem.process + " for being disabled. "); + continue; + } + /* Now we will read the config of the bot from the path we obtained at the AACloud config. */ let botConfig; diff --git a/Status Report.js b/Status Report.js index b9f713d65..ebc2407fd 100644 --- a/Status Report.js +++ b/Status Report.js @@ -25,7 +25,6 @@ let owner; // This is the bot owner of the Status Report. Only owners can save the report and override the existing content. const logger = DEBUG_MODULE.newDebugLog(); - logger.fileName = MODULE_NAME; logger.bot = bot; /* Utilities needed. */ @@ -46,7 +45,7 @@ try { - logger.fileName = MODULE_NAME + "." + pOwner.bot; + logger.fileName = MODULE_NAME + "." + pOwner.bot + "." + pOwner.process; owner = pOwner; month = pMonth; @@ -54,7 +53,7 @@ if (owner.dataSetSection === "Month") { - logger.fileName = MODULE_NAME + "." + pOwner.bot + "." + year + "." + month; + logger.fileName = MODULE_NAME + "." + pOwner.bot + "." + pOwner.process + "." + year + "." + month; timePath = "/" + year + "/" + month; } diff --git a/this.config.json b/this.config.json index 7ecbde81a..197622311 100644 --- a/this.config.json +++ b/this.config.json @@ -7,16 +7,23 @@ }, "executionList": [ { + "enabled": "false", "botPath": "../Bots/AAMasters/AAMariam-Trading-Bot", "process": "Trading-Process" }, { + "enabled": "false", "botPath": "../Bots/AAMasters/AAOlivia-Indicator-Bot", "process": "Multi-Period-Market" + }, + { + "enabled": "true", + "botPath": "../Bots/AAMasters/AACharly-Extraction-Bot", + "process": "Poloniex-Hole-Fixing" } ], "stopGracefully": "true", "exchangeSimulationMode": "false", - "storageConnStringFolder": "Mixed", + "storageConnStringFolder": "Testnet", "maxLogLoops": 10 } \ No newline at end of file