Fix #84, with one caveat
This commit is contained in:
@@ -185,19 +185,18 @@ export default {
|
||||
const { from, to, firstDataRequest } = periodParams;
|
||||
console.log('[getBars]: Method call', symbolInfo, resolution, from, to);
|
||||
|
||||
try {
|
||||
var bars = await jBars(from, to, resolution); // This is the one that does all the work
|
||||
|
||||
try {
|
||||
let bars, metadata;
|
||||
[bars, metadata] = await jBars(from, to, resolution); // This is the one that does all the work
|
||||
if (firstDataRequest) {
|
||||
lastBarsCache.set(symbolInfo.full_name, {
|
||||
...bars[bars.length - 1],
|
||||
});
|
||||
}
|
||||
console.log(`[getBars]: returned ${bars.length} bar(s)`);
|
||||
console.log(`[getBars]: returned ${bars.length} bar(s), and metadata ${metadata}`);
|
||||
console.log(bars);
|
||||
onHistoryCallback(bars, {
|
||||
noData: false,
|
||||
});
|
||||
onHistoryCallback(bars, metadata);
|
||||
} catch (error) {
|
||||
console.log('[getBars]: Get error', error);
|
||||
onErrorCallback(error);
|
||||
|
||||
Reference in New Issue
Block a user