From 87b1cad4f57a16d23a07215e47ff1feeca3da638 Mon Sep 17 00:00:00 2001 From: Boki Date: Sat, 28 Jun 2025 21:03:58 -0400 Subject: [PATCH] fixed up a few things --- .../src/handlers/qm/actions/index.ts | 13 +++--- .../src/handlers/qm/actions/price.action.ts | 40 ------------------- .../src/handlers/qm/qm.handler.ts | 33 ++++++--------- 3 files changed, 19 insertions(+), 67 deletions(-) delete mode 100644 apps/stock/data-ingestion/src/handlers/qm/actions/price.action.ts diff --git a/apps/stock/data-ingestion/src/handlers/qm/actions/index.ts b/apps/stock/data-ingestion/src/handlers/qm/actions/index.ts index 2a2e201..ebae778 100644 --- a/apps/stock/data-ingestion/src/handlers/qm/actions/index.ts +++ b/apps/stock/data-ingestion/src/handlers/qm/actions/index.ts @@ -2,13 +2,12 @@ * QM Action Exports */ +export { scheduleCorporateActionsUpdates, updateCorporateActions } from './corporate-actions.action'; +export { scheduleFilingsUpdates, updateFilings } from './filings.action'; +export { scheduleFinancialsUpdates, updateFinancials } from './financials.action'; +export { scheduleIntradayUpdates, updateIntradayBars } from './intraday.action'; +export { schedulePriceUpdates, updatePrices } from './prices.action'; export { checkSessions, createSession } from './session.action'; +export { scheduleSymbolInfoUpdates, updateSymbolInfo } from './symbol-info.action'; export { searchSymbols, spiderSymbol } from './symbol.action'; -export { getOperationStats } from './price.action'; -export { updateSymbolInfo, scheduleSymbolInfoUpdates } from './symbol-info.action'; -export { updateFinancials, scheduleFinancialsUpdates } from './financials.action'; -export { updateCorporateActions, scheduleCorporateActionsUpdates } from './corporate-actions.action'; -export { updateFilings, scheduleFilingsUpdates } from './filings.action'; -export { updatePrices, schedulePriceUpdates } from './prices.action'; -export { updateIntradayBars, scheduleIntradayUpdates } from './intraday.action'; diff --git a/apps/stock/data-ingestion/src/handlers/qm/actions/price.action.ts b/apps/stock/data-ingestion/src/handlers/qm/actions/price.action.ts deleted file mode 100644 index 7867d3c..0000000 --- a/apps/stock/data-ingestion/src/handlers/qm/actions/price.action.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * QM Price Actions - Operation statistics - */ - -import type { BaseHandler, ExecutionContext } from '@stock-bot/handlers'; -import { QMOperationTracker } from '../shared/operation-tracker'; - -// Cache tracker instance -let operationTracker: QMOperationTracker | null = null; - -/** - * Get or initialize the operation tracker - */ -async function getOperationTracker(handler: BaseHandler): Promise { - if (!operationTracker) { - const { initializeQMOperations } = await import('../shared/operation-registry'); - operationTracker = await initializeQMOperations(handler.mongodb, handler.logger); - } - return operationTracker; -} - -/** - * Get operation statistics - */ -export async function getOperationStats( - this: BaseHandler, - input: { - operation: string; - }, - _context?: ExecutionContext -): Promise { - const tracker = await getOperationTracker(this); - - const stats = await tracker.getOperationStats(input.operation); - - return { - operation: input.operation, - ...stats - }; -} \ No newline at end of file diff --git a/apps/stock/data-ingestion/src/handlers/qm/qm.handler.ts b/apps/stock/data-ingestion/src/handlers/qm/qm.handler.ts index 2bae5ee..db8d918 100644 --- a/apps/stock/data-ingestion/src/handlers/qm/qm.handler.ts +++ b/apps/stock/data-ingestion/src/handlers/qm/qm.handler.ts @@ -4,24 +4,23 @@ import { Operation, ScheduledOperation, } from '@stock-bot/handlers'; -import { - checkSessions, - createSession, - searchSymbols, - spiderSymbol, - getOperationStats, - updateSymbolInfo, - scheduleSymbolInfoUpdates, - updateFinancials, - scheduleFinancialsUpdates, - updateCorporateActions, +import { + checkSessions, + createSession, scheduleCorporateActionsUpdates, - updateFilings, scheduleFilingsUpdates, - updatePrices, + scheduleFinancialsUpdates, + scheduleIntradayUpdates, schedulePriceUpdates, + scheduleSymbolInfoUpdates, + searchSymbols, + spiderSymbol, + updateCorporateActions, + updateFilings, + updateFinancials, updateIntradayBars, - scheduleIntradayUpdates + updatePrices, + updateSymbolInfo } from './actions'; import { initializeQMOperations } from './shared/operation-registry'; @@ -138,10 +137,4 @@ export class QMHandler extends BaseHandler { description: 'Check for symbols needing intraday updates every 30 minutes' }) scheduleIntradayUpdates = scheduleIntradayUpdates; - - /** - * MONITORING - */ - @Operation('get-operation-stats') - getOperationStats = getOperationStats; }