work on spider for te

This commit is contained in:
Boki 2025-07-06 15:26:47 -04:00
parent 505565a09e
commit 95b1381480
17 changed files with 485 additions and 28 deletions

View file

@ -1,29 +1,31 @@
import {
BaseHandler,
Disabled,
Handler,
Operation,
ScheduledOperation,
ScheduledOperation
} from '@stock-bot/handlers';
import type { DataIngestionServices } from '../../types';
import { fetchCountries, spiderUrl } from './actions';
@Handler('te')
export class TeHandler extends BaseHandler {
@Disabled()
export class TeHandler extends BaseHandler<DataIngestionServices> {
constructor(services: any) {
super(services);
}
@Operation('example-operation')
async exampleOperation(): Promise<unknown> {
this.logger.info('TE handler example operation executed');
return { success: true };
}
@ScheduledOperation('te-scheduled-job', '0 0 * * *', {
@ScheduledOperation('te-countries', '0 0 * * 0', {
priority: 5,
description: 'Daily TE handler scheduled job',
immediately: false,
description: 'Fetch and update Trading Economics countries data',
immediately: true,
})
async scheduledJob(): Promise<unknown> {
this.logger.info('TE handler scheduled job executed');
return this.exampleOperation();
}
@Disabled()
fetchCountries = fetchCountries;
@ScheduledOperation('te-spider', '0 0 * * 0', {
priority: 5,
description: 'Fetch and update Trading Economics countries data',
immediately: true,
})
spiderUrlSchedule = spiderUrl;
}