fixed up a few things

This commit is contained in:
Boki 2025-06-28 21:03:58 -04:00
parent c799962f05
commit 87b1cad4f5
3 changed files with 19 additions and 67 deletions

View file

@ -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';

View file

@ -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<QMOperationTracker> {
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<any> {
const tracker = await getOperationTracker(this);
const stats = await tracker.getOperationStats(input.operation);
return {
operation: input.operation,
...stats
};
}

View file

@ -7,21 +7,20 @@ import {
import {
checkSessions,
createSession,
scheduleCorporateActionsUpdates,
scheduleFilingsUpdates,
scheduleFinancialsUpdates,
scheduleIntradayUpdates,
schedulePriceUpdates,
scheduleSymbolInfoUpdates,
searchSymbols,
spiderSymbol,
getOperationStats,
updateSymbolInfo,
scheduleSymbolInfoUpdates,
updateFinancials,
scheduleFinancialsUpdates,
updateCorporateActions,
scheduleCorporateActionsUpdates,
updateFilings,
scheduleFilingsUpdates,
updatePrices,
schedulePriceUpdates,
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;
}