import { BaseHandler, Handler, Operation, ScheduledOperation, type IServiceContainer, } from '@stock-bot/handlers'; import { getChannels, getPosts, getShorts, updateUniqueSymbols } from './actions'; @Handler('ceo') // @Disabled() export class CeoHandler extends BaseHandler { constructor(services: IServiceContainer) { super(services); // Handler name read from @Handler decorator } @ScheduledOperation('get-channels', '0 */15 * * *', { priority: 7, immediately: false, description: 'Get all CEO symbols and exchanges', }) getChannels = getChannels; @Operation('update-unique-symbols-posts') @ScheduledOperation('update-unique-symbols-posts', '30 * * * *', { immediately: false, description: 'Process unique CEO symbols and schedule individual jobs', payload: { action: 'get-posts' }, batch: { size: 100, delayInHours: 0.5, } }) updateUniqueSymbolsPosts = updateUniqueSymbols; @Operation('update-unique-symbols-shorts') @ScheduledOperation('update-unique-symbols-shorts', '0 0 * * *', { immediately: false, description: 'Process unique CEO symbols and schedule individual jobs', payload: { action: 'get-shorts' }, batch: { size: 50, delayInHours: 2, direct: true, // Use direct mode for shorts } }) updateUniqueSymbolsShorts = updateUniqueSymbols; @Operation('get-posts') getPosts = getPosts; @Operation('get-shorts') getShorts = getShorts; }