From 2ff363c8f5fb945093cf932851654f8bc3568981 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 18 Feb 2018 13:49:27 +0100 Subject: [PATCH] Requesting new execution in 30 sec if can not read candles from bruce --- Multi-Period-Market/Interval.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Multi-Period-Market/Interval.js b/Multi-Period-Market/Interval.js index 94263df44..a33eba1a0 100644 --- a/Multi-Period-Market/Interval.js +++ b/Multi-Period-Market/Interval.js @@ -92,6 +92,7 @@ Read the candles and volumes from Bruce and produce a single Index File for each } 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 marketQueue; // This is the queue of all markets to be procesesd at each interval. let market = { // This is the current market being processed after removing it from the queue. @@ -160,7 +161,7 @@ Read the candles and volumes from Bruce and produce a single Index File for each const logText = "[WARN] We processed all the markets."; logger.write(logText); - callBackFunction(nextIntervalExecution); + callBackFunction(nextIntervalExecution, nextIntervalLapse); return; } @@ -651,6 +652,9 @@ Read the candles and volumes from Bruce and produce a single Index File for each closeAndOpenMarket(); + nextIntervalExecution = true; // we request a new interval execution. + nextIntervalLapse = 30000; + return; }