Bug Fix: Accept Empty OHLCV if at the Current Minute

This commit is contained in:
Smidy13 committed 2021-06-23 23:13:56 +12:00
1 parent fbf3bce170
commit 6e178fe3ec
1 file changed
+6 -3
@@ -418,18 +418,21 @@
await exchange.fetchOHLCV(symbol, '1m', since, limit, params)
if (OHLCVs.length === 0) {
if (OHLCVs.length === 0 && new Date(since).valueOf() !== (new Date).setSeconds(0,0)) {
/*
If OHLCVs is empty we might be dealing with extended maintenance longer than our OHLCV limit.
If OHLCVs is empty and we're not at the current minute we might
be dealing with extended maintenance longer than our OHLCV limit.
If this is the case jump forward to the next valid OHLCV record.
*/
since = await findNextValidOHLCV()
}
/*
CCXT for certain Exchanges will return an empty or partial array if the since date is too
far in the past if this occurs this function will recursively step backwards in the Exchange
and Market in 1D intervals until it finds the earliest date with values.
and Market in 1D intervals until it finds the earliest date with values.
*/
async function findMarketStart() {