【发布时间】:2020-03-13 09:10:27
【问题描述】:
我正在关注doc 开始使用队列。我安装了@nestjs/bull、bull、@types/bull 依赖项。这是我的app.module.ts:
@Module({
imports: [
ConfigModule.forRoot({
load: [configuration],
}),
BullModule.registerQueue({
name: 'create_checkin',
redis: {
host: 'localhost',
port: 6379,
},
}),
EventModule,
],
})
export class AppModule {}
我在根模块中导入了 BullModule。这是我的event.service.ts:
@Injectable()
export class EventService {
constructor(
@InjectQueue('create_checkin') private readonly createCheckinQueue: Queue,
) {
}
}
当我启动服务器时,我收到以下错误消息:
Nest can't resolve dependencies of the EventService
Please make sure that the argument BullQueue_create_checkin at index [0] is available in the EventModule context.
我不知道我做错了哪一步。有人可以帮助我吗?
【问题讨论】:
-
您在哪里提供了 EventService?你能提供更多你的代码吗?
标签: nestjs