Spaces:
Sleeping
Sleeping
Download src/modules/queue/queue.module.ts from jinksQspider/openWa: direct link, hf CLI and curl.
- Browser
- Download file 1.66 kB
-
https://huggingface.co/spaces/jinksQspider/openWa/resolve/main/src/modules/queue/queue.module.ts
- Command line
-
hf download hf://spaces/jinksQspider/openWa/src/modules/queue/queue.module.ts
-
curl -L -o queue.module.ts https://huggingface.co/spaces/jinksQspider/openWa/resolve/main/src/modules/queue/queue.module.ts
1.66 kB
| import { Module } from '@nestjs/common'; | |
| import { ConfigModule, ConfigService } from '@nestjs/config'; | |
| import { BullModule } from '@nestjs/bullmq'; | |
| import { BullBoardModule } from '@bull-board/nestjs'; | |
| import { BullMQAdapter } from '@bull-board/api/bullMQAdapter'; | |
| import { ExpressAdapter } from '@bull-board/express'; | |
| import { TypeOrmModule } from '@nestjs/typeorm'; | |
| import { WebhookProcessor } from './processors/webhook.processor'; | |
| import { QUEUE_NAMES } from './queue-names'; | |
| import { Webhook } from '../webhook/entities/webhook.entity'; | |
| import { HooksModule } from '../../core/hooks/hooks.module'; | |
| // Re-export for backward compatibility | |
| export { QUEUE_NAMES } from './queue-names'; | |
| ({ | |
| imports: [ | |
| // Required for WebhookProcessor to inject Repository<Webhook> | |
| TypeOrmModule.forFeature([Webhook], 'data'), | |
| // Required for WebhookProcessor to inject HookManager | |
| HooksModule, | |
| BullModule.forRootAsync({ | |
| imports: [ConfigModule], | |
| inject: [ConfigService], | |
| useFactory: (configService: ConfigService) => ({ | |
| connection: { | |
| host: configService.get<string>('redis.host', 'localhost'), | |
| port: configService.get<number>('redis.port', 6379), | |
| password: configService.get<string>('redis.password'), | |
| }, | |
| }), | |
| }), | |
| BullModule.registerQueue({ name: QUEUE_NAMES.WEBHOOK }), | |
| BullBoardModule.forRoot({ | |
| route: '/admin/queues', | |
| adapter: ExpressAdapter, | |
| }), | |
| BullBoardModule.forFeature({ | |
| name: QUEUE_NAMES.WEBHOOK, | |
| adapter: BullMQAdapter, | |
| }), | |
| ], | |
| providers: [WebhookProcessor], | |
| exports: [BullModule], | |
| }) | |
| export class QueueModule {} | |