finished up intraday EOD
This commit is contained in:
parent
7486a1fa65
commit
d8e7449605
1 changed files with 16 additions and 15 deletions
|
|
@ -52,22 +52,23 @@ export async function scheduleIntradayCrawl(
|
||||||
delisted: false
|
delisted: false
|
||||||
}).toArray();
|
}).toArray();
|
||||||
|
|
||||||
// Filter out delisted symbols and ensure we get AAPL with US exchange
|
|
||||||
const activeSymbols = symbolsForInterval.filter(item =>
|
|
||||||
item.symbol.delisted === false &&
|
|
||||||
item.symbol.Code === 'AAPL' &&
|
|
||||||
item.symbol.eodExchange === 'US'
|
|
||||||
);
|
|
||||||
|
|
||||||
// Add interval info to each symbol
|
// Add interval info to each symbol
|
||||||
activeSymbols.forEach(item => {
|
symbolsForInterval.forEach(symbol => {
|
||||||
|
// Check if this interval needs processing (not finished or needs new data)
|
||||||
|
const operationStatus = symbol.operations?.[operationName];
|
||||||
|
const shouldProcess = !operationStatus || !operationStatus.finished ||
|
||||||
|
(operationStatus.newestDateReached &&
|
||||||
|
new Date(operationStatus.newestDateReached) < new Date(Date.now() - 24 * 60 * 60 * 1000)); // Check if newest date is more than 1 day old
|
||||||
|
|
||||||
|
if (shouldProcess) {
|
||||||
allSymbolsForCrawl.push({
|
allSymbolsForCrawl.push({
|
||||||
symbol: item.symbol,
|
symbol: symbol,
|
||||||
interval: interval,
|
interval: interval,
|
||||||
operationName: operationName,
|
operationName: operationName,
|
||||||
lastRun: item.lastRun,
|
lastRun: operationStatus?.lastRunAt,
|
||||||
lastSuccess: item.lastSuccess
|
lastSuccess: operationStatus?.lastSuccessAt
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue