fixed up a few things
This commit is contained in:
parent
c799962f05
commit
87b1cad4f5
3 changed files with 19 additions and 67 deletions
|
|
@ -2,13 +2,12 @@
|
||||||
* QM Action Exports
|
* 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 { checkSessions, createSession } from './session.action';
|
||||||
|
export { scheduleSymbolInfoUpdates, updateSymbolInfo } from './symbol-info.action';
|
||||||
export { searchSymbols, spiderSymbol } from './symbol.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';
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -7,21 +7,20 @@ import {
|
||||||
import {
|
import {
|
||||||
checkSessions,
|
checkSessions,
|
||||||
createSession,
|
createSession,
|
||||||
|
scheduleCorporateActionsUpdates,
|
||||||
|
scheduleFilingsUpdates,
|
||||||
|
scheduleFinancialsUpdates,
|
||||||
|
scheduleIntradayUpdates,
|
||||||
|
schedulePriceUpdates,
|
||||||
|
scheduleSymbolInfoUpdates,
|
||||||
searchSymbols,
|
searchSymbols,
|
||||||
spiderSymbol,
|
spiderSymbol,
|
||||||
getOperationStats,
|
|
||||||
updateSymbolInfo,
|
|
||||||
scheduleSymbolInfoUpdates,
|
|
||||||
updateFinancials,
|
|
||||||
scheduleFinancialsUpdates,
|
|
||||||
updateCorporateActions,
|
updateCorporateActions,
|
||||||
scheduleCorporateActionsUpdates,
|
|
||||||
updateFilings,
|
updateFilings,
|
||||||
scheduleFilingsUpdates,
|
updateFinancials,
|
||||||
updatePrices,
|
|
||||||
schedulePriceUpdates,
|
|
||||||
updateIntradayBars,
|
updateIntradayBars,
|
||||||
scheduleIntradayUpdates
|
updatePrices,
|
||||||
|
updateSymbolInfo
|
||||||
} from './actions';
|
} from './actions';
|
||||||
import { initializeQMOperations } from './shared/operation-registry';
|
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'
|
description: 'Check for symbols needing intraday updates every 30 minutes'
|
||||||
})
|
})
|
||||||
scheduleIntradayUpdates = scheduleIntradayUpdates;
|
scheduleIntradayUpdates = scheduleIntradayUpdates;
|
||||||
|
|
||||||
/**
|
|
||||||
* MONITORING
|
|
||||||
*/
|
|
||||||
@Operation('get-operation-stats')
|
|
||||||
getOperationStats = getOperationStats;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue