work on qm
This commit is contained in:
parent
6082a54d14
commit
5640444c47
9 changed files with 492 additions and 476 deletions
|
|
@ -31,6 +31,7 @@ export async function updateIntradayBars(
|
|||
input: {
|
||||
symbol: string;
|
||||
symbolId: number;
|
||||
qmSearchCode: string;
|
||||
crawlDate?: string; // ISO date string for specific date crawl
|
||||
},
|
||||
_context?: ExecutionContext
|
||||
|
|
@ -40,7 +41,7 @@ export async function updateIntradayBars(
|
|||
message: string;
|
||||
data?: any;
|
||||
}> {
|
||||
const { symbol, symbolId, crawlDate } = input;
|
||||
const { symbol, symbolId, qmSearchCode, crawlDate } = input;
|
||||
|
||||
this.logger.info('Fetching intraday bars', { symbol, symbolId, crawlDate });
|
||||
|
||||
|
|
@ -203,9 +204,9 @@ export async function scheduleIntradayUpdates(
|
|||
|
||||
// Get full symbol data
|
||||
symbolsToProcess = await this.mongodb.find('qmSymbols', {
|
||||
symbol: { $in: staleSymbols }
|
||||
qmSearchCode: { $in: staleSymbols }
|
||||
}, {
|
||||
projection: { symbol: 1, symbolId: 1 }
|
||||
projection: { symbol: 1, symbolId: 1, qmSearchCode: 1 }
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -245,6 +246,7 @@ export async function scheduleIntradayUpdates(
|
|||
await this.scheduleOperation('update-intraday-bars', {
|
||||
symbol: doc.symbol,
|
||||
symbolId: doc.symbolId,
|
||||
qmSearchCode: doc.qmSearchCode,
|
||||
crawlDate: crawlDate.toISOString()
|
||||
}, {
|
||||
priority: 6,
|
||||
|
|
@ -255,7 +257,7 @@ export async function scheduleIntradayUpdates(
|
|||
}
|
||||
|
||||
// Update crawl state
|
||||
await tracker.updateSymbolOperation(doc.symbol, 'intraday_bars', {
|
||||
await tracker.updateSymbolOperation(doc.qmSearchCode, 'intraday_bars', {
|
||||
status: 'partial',
|
||||
crawlState: {
|
||||
finished: false,
|
||||
|
|
@ -266,7 +268,8 @@ export async function scheduleIntradayUpdates(
|
|||
// For update mode, just fetch today's data
|
||||
await this.scheduleOperation('update-intraday-bars', {
|
||||
symbol: doc.symbol,
|
||||
symbolId: doc.symbolId
|
||||
symbolId: doc.symbolId,
|
||||
qmSearchCode: doc.qmSearchCode
|
||||
}, {
|
||||
priority: 8, // High priority for current data
|
||||
delay: jobsQueued * 500 // 0.5 seconds between jobs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue