Skip to content
This repository was archived by the owner on Feb 16, 2020. It is now read-only.

Commit 5a798fb

Browse files
eusorovaskmike
authored andcommitted
when empty data returns, loader never finishes and never get killed
1 parent a418c4a commit 5a798fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/tools/candleLoader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const handleCandles = (err, data) => {
7878
util.die('Encountered an error..')
7979
}
8080

81-
if(_.size(data) && _.last(data).start >= toUnix)
81+
if(_.size(data) && _.last(data).start >= toUnix || iterator.from.unix() >= toUnix)
8282
DONE = true;
8383

8484
batcher.write(data);
@@ -97,4 +97,4 @@ const handleCandles = (err, data) => {
9797

9898
const handleBatchedCandles = candle => {
9999
result.push(candle);
100-
}
100+
}

0 commit comments

Comments
 (0)