From e6f29fe7f593f6229bd4dcc0f0a7ec0320cd9be5 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 30 Mar 2018 17:30:41 +0200 Subject: [PATCH] RETRY loop BUG when status report is corrupt --- .vs/AAOlivia-Indicator-Bot/v15/.suo | Bin 33280 -> 32768 bytes Multi-Period-Daily/User.bot.js | 21 +++++++++++++++++++++ Multi-Period-Market/User.bot.js | 21 +++++++++++++++++++++ this.bot.config.json | 4 ++-- 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/.vs/AAOlivia-Indicator-Bot/v15/.suo b/.vs/AAOlivia-Indicator-Bot/v15/.suo index 8ab82730a1511fec4161c8a8e0803f9a2086bec6..69d181b2ca5b1bd095f6ac8386a23e7a8a488e41 100644 GIT binary patch delta 1397 zcmah|OH5Ni6n!)O@TyaMwS`u#P(llc&;tHYARsLtiO~vv5>$#BSr~}X6cZ#WCbDB8 zy)HB+XrAt5A)Um9A^yNm;=-y67aC*YhM4$S)WjzK?zHbEZPYl)$-Q&t-kJN(y>ILs z9UG(P8;NzMDL_pLPqTjkj+wh*j*iPVNs@lyg6BnEh#JC7L83I9Od2X$L{vUP9OfZ@ zVul&5$Xuk^#b^r$)tar=tRHOvQLF9OXm%~yb%^zd4TyTgMnnTbyw@m6{Ik(U;)~`f zqeu$z#6eo-(+b=eA!U0C zAwvx$S(sUoVOb#%wNJz=g9IC23(?hK5ol?}fCNHL)I2(dEcT{)LJwp&R#GGb0LO86__ zn`0|8AR!v2%LCEkFsnc!TS(JMBxZTa_Y`ZOHH*cYG6EO;+W)v*Y&!H?LG`nLw*}$l})*REM z$$jIW(ukk)uhNJ)(aT|JX^;>LY6qMU=ykx&Jq5gF=RKmHrt!*o!t`0wvrOq>fRwMx znif+0Hu@QlmQ9dYVGx1_93D@YiB5`tTMvMw=b4ZUY9ph3w0+#5R#B8s3>l9qI5OL) zT1VAx{A3#6O(?wZH}jVD_Xw2q1bCqLIe{IWUA(LQ7J(nbJy6`S9Ht`qFxvis^ua*K z42{?IN$*KVVfveyUYK+alm!)#6qyYNP=Z4H82<5D#87)gYP(Q4VX3oBhJ8Ev;M_NCg1z!%}nRb&UAQ~4`1Qe zQ>^^)jyNyNJ-B@5-NZCo1!ws*WPJ%3EI9~8U&_*|A)#yVQ44HX=J9yuQECxaqk0u5 zTea&Pg$ac%3fmNt&sNu&_%`IbsE5$3>o<;mD=aB; zL9L>ek^@W`QJ4wkL^&FS+n5g@*2#l}ysQ9SB{8Myr#i%vS7Diuy2lX1&1{cJ5Vcfm4m;Kz$%9UOZZRlPJv?H1h%m|#}! zfZ@dAZ9bS2zqe1$Bn7u>GLQ-4N2~c`XkfPHm7qPRxpyinrM2WR7d{|pv7HrJn8tjh z3(QCo((M||rqwWX9M)-4e#S4n4Cbo#FTTh9>V@|dS{a9y*pR%i_i72eG14;KK2~BM z;*gA8AS1I+dhINSx}La<_f9dqvev$=U^Hz?d~ETrAOn-#YpmFd0KdQN!PwVl?_N&d zeEsm&`+f+-BebobVj;VmL&uS0kn7ne?GwitBnPS>-W!2OM=E4GHOA}#UO4rZixMY0 zqWsuvFnc2l^h|1J4&1vN+S<71dTV&%4JQ6V)r`2Dui}}8@PF0FPp2nXW!4qhhi4kU i%p;iUz9h2)PnkWW*@J)nt_+<2;)OHkF3O8LudpB6-9l{u diff --git a/Multi-Period-Daily/User.bot.js b/Multi-Period-Daily/User.bot.js index 2fa88f058..cda1bb910 100644 --- a/Multi-Period-Daily/User.bot.js +++ b/Multi-Period-Daily/User.bot.js @@ -109,6 +109,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.") { + 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; if (thisReport.lastFile === undefined) { @@ -128,6 +135,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.") { + 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; if (thisReport.lastFile === undefined) { @@ -146,6 +160,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.") { + 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; if (thisReport.lastFile !== undefined) { diff --git a/Multi-Period-Market/User.bot.js b/Multi-Period-Market/User.bot.js index f86f42845..d7bed44c3 100644 --- a/Multi-Period-Market/User.bot.js +++ b/Multi-Period-Market/User.bot.js @@ -109,6 +109,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.") { + 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; if (thisReport.lastFile === undefined) { @@ -128,6 +135,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.") { + 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; if (thisReport.lastFile === undefined) { @@ -146,6 +160,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.") { + 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; if (thisReport.lastFile !== undefined) { diff --git a/this.bot.config.json b/this.bot.config.json index 2f487e9fa..49fef7af8 100644 --- a/this.bot.config.json +++ b/this.bot.config.json @@ -139,7 +139,7 @@ { "type": "Daily Files", "validPeriods": [ "45-min", "40-min", "30-min", "20-min", "15-min", "10-min", "05-min", "04-min", "03-min", "02-min", "01-min" ], - "filePath": "@Exchange/Output/Candles/Multi-Period-Daily/@Period/@Year/@Month/@Day", + "filePath": "AAMasters/AAOlivia.1.0/AACloud.1.0/@Exchange/DataSet.V.1/Output/Candles/Multi-Period-Daily/@Period/@Year/@Month/@Day", "fileName": "@AssetA_@AssetB.json" } ], @@ -169,7 +169,7 @@ { "type": "Daily Files", "validPeriods": [ "45-min", "40-min", "30-min", "20-min", "15-min", "10-min", "05-min", "04-min", "03-min", "02-min", "01-min" ], - "filePath": "@Exchange/Output/Volumes/Multi-Period-Daily/@Period/@Year/@Month/@Day", + "filePath": "AAMasters/AAOlivia.1.0/AACloud.1.0/@Exchange/DataSet.V.1/Output/Volumes/Multi-Period-Daily/@Period/@Year/@Month/@Day", "fileName": "@AssetA_@AssetB.json" } ],