finished up intraday EOD

This commit is contained in:
Boki 2025-07-10 08:50:07 -04:00
parent 7486a1fa65
commit d8e7449605

View file

@ -52,22 +52,23 @@ export async function scheduleIntradayCrawl(
delisted: false
}).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
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({
symbol: item.symbol,
symbol: symbol,
interval: interval,
operationName: operationName,
lastRun: item.lastRun,
lastSuccess: item.lastSuccess
lastRun: operationStatus?.lastRunAt,
lastSuccess: operationStatus?.lastSuccessAt
});
}
});
}