37 lines
1 KiB
TypeScript
37 lines
1 KiB
TypeScript
import {
|
|
BaseHandler,
|
|
Handler,
|
|
Operation,
|
|
ScheduledOperation,
|
|
} from '@stock-bot/handlers';
|
|
import { checkSessions, createSession, searchSymbols, spiderSymbolSearch } from './actions';
|
|
|
|
@Handler('qm')
|
|
export class QMHandler extends BaseHandler {
|
|
constructor(services: any) {
|
|
super(services); // Handler name read from @Handler decorator
|
|
}
|
|
|
|
@ScheduledOperation('check-sessions', '*/2 * * * *', {
|
|
priority: 8,
|
|
immediately: false,
|
|
description: 'Check and maintain QM sessions every 2 minutes',
|
|
})
|
|
checkSessions = checkSessions;
|
|
|
|
@Operation('create-session')
|
|
createSession = createSession;
|
|
|
|
@ScheduledOperation('spider-symbol-search', '* * * * *', {
|
|
priority: 8,
|
|
immediately: false,
|
|
description: 'Weekly comprehensive symbol search using QM API spider - runs every Saturday at midnight'
|
|
})
|
|
spiderSymbolSchedule = spiderSymbolSearch;
|
|
|
|
@Operation('spider-symbols')
|
|
spiderSymbolsJob = spiderSymbolSearch;
|
|
|
|
@Operation('search-symbols')
|
|
searchSymbols = searchSymbols;
|
|
}
|