From a381bdafccc9b938f88369c6715ddf07e1ff977a Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 14 Mar 2018 10:20:41 +0100 Subject: [PATCH] Main error handlers and main callback set --- .vs/AAOlivia-Indicator-Bot/v15/.suo | Bin 23040 -> 22016 bytes Multi-Period-Market/Interval.js | 29 +++++++++++++--------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.vs/AAOlivia-Indicator-Bot/v15/.suo b/.vs/AAOlivia-Indicator-Bot/v15/.suo index d8fd7cb27e4f3fbd3cc66112fb5e9e114680b9b7..05f415645663ab96a56a04c78b37d312fba07eea 100644 GIT binary patch delta 761 zcmb_a%}&BV5bhQVRhFXiCukKCFWw+RG!fJYhZ-z_#|AoSZ4`M%E1$E@?~ef&NnmrrL8y8dLj?0gkYaJL5N^X5I>e>ahk_3M;!td zIV2%SimTFd;r6isHSq%q-W!S<0c%GG-jy{NxX#o?B$p7p%QD_^#0nyYP}!yXlZ<<% zuKo87R`VPa=(_Tz98x`4GK1jKS-fQgMR*ZDmX?FkXe6ij%+W|AU6pyl4=1G2_Ard< z6Eql^s+@ER2bl_0kO(+QBil9=ZBn_HaI*`gOrW=sGb5Vpn-E0$G%+UZ6~KsAD7S$> z+a@LMuA2?BB|_&hg(SgrqL#$!Eu4zcSKm(NI<9@LMkpuyg)BSdnmV@5E2#w z&w-afLa;nQBzmaCC4xub6?`BU%*+xyuBFl1-^@2V^UZkniOs&T_x-L>SUpamVB#x7 z`dVmri-mHPxx}m6C>kypAo~WaP zT1iPT>tMRZ8y0y!oVj;k=AFa2aTDZL7*!u|k}Hdq)didxeUP;=_+H=g&}qW56mU{y z9cGV38G&9NjP0PrD5RT5<*hJk`hsv0nNDg&$!36ZQhrh`gX7k;&UbPMNHOJh9*D(Q z(9B8Yln1gj<-0i`({?1%BC}Z37fziYFx(@@x^i!K^w>b7VzKEl!+X<;sE>)|Z1ve;XQ3Wm{|W;_Bo zEGv)xSDbF6UK?2*>)FNCDd#y74O5Wz>Hg_eT1|F)B&z75deTckHpjXw`Y|$a-ZRyo j{rffMtNqDCR=hrchVC2c-P4ywG`Y)m5gsw?MF#!@jA&Lt diff --git a/Multi-Period-Market/Interval.js b/Multi-Period-Market/Interval.js index 385a7cb4d..e73ec8b4b 100644 --- a/Multi-Period-Market/Interval.js +++ b/Multi-Period-Market/Interval.js @@ -58,12 +58,11 @@ bruceAzureFileStorage.initialize("Bruce"); oliviaAzureFileStorage.initialize("Olivia"); + callBackFunction(global.DEFAULT_OK_RESPONSE); + } catch (err) { - - const logText = "[ERROR] initialize - ' ERROR : " + err.message; - console.log(logText); - logger.write(logText); - + logger.write("[ERROR] initialize -> err = " + err.message); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); } } @@ -71,7 +70,7 @@ This process is going to do the following: -Read the candles and volumes from Bruce and produce a single Index File for each market with daily candles and volumes. +Read the candles and volumes from Bruce and produce a single Index File for Market Period. */ @@ -81,14 +80,14 @@ Read the candles and volumes from Bruce and produce a single Index File for each if (FULL_LOG === true) { logger.write("[INFO] start -> Entering function."); } - let nextIntervalExecution = false; // This tell weather the Interval module will be executed again or not. By default it will not unless some hole have been found in the current execution. - let nextIntervalLapse; // With this we can request the next execution wait time. + let nextIntervalExecution = false; // This tell weather the Interval module will be executed again or not. By default it will not unless some hole have been found in the current execution. + let nextIntervalLapse; // With this we can request the next execution wait time. let market = global.MARKET; - let lastCandleFile; // Datetime of the last file included on the Index File. - let firstTradeFile; // Datetime of the first trade file in the whole market history. - let maxCandleFile; // Datetime of the last file available to be included in the Index File. + let lastCandleFile; // Datetime of the last file included on the Index File. + let firstTradeFile; // Datetime of the first trade file in the whole market history. + let maxCandleFile; // Datetime of the last file available to be included in the Index File. getStatusReport(); @@ -419,10 +418,8 @@ Read the candles and volumes from Bruce and produce a single Index File for each const logText = "[INFO] 'buildCandles' - Head of the market found @ " + lastCandleFile.getUTCFullYear() + "/" + (lastCandleFile.getUTCMonth() + 1) + "/" + lastCandleFile.getUTCDate() + "."; logger.write(logText); - - + callBackFunction(global.DEFAULT_OK_RESPONSE); // Here is where we finish processing and wait for the platform to run this module again. return; - } periodsLoop(); @@ -915,8 +912,8 @@ Read the candles and volumes from Bruce and produce a single Index File for each } catch (err) { - const logText = "[ERROR] 'Start' - ERROR : " + err.message; - logger.write(logText); + logger.write("[ERROR] start -> err = " + err.message); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); } } };