我尝试使用“Nestjs/Bull”并使用插件“Heroku Data for Redis”作为部署Heroku应用程序中的Redis。
但似乎连接失败,没有作业排队和执行。
下面是我在app.module.ts
中的bull配置:
imports: [
BullModule.forRootAsync({ useClass: ConfigBull }),
]
下面是ConfigBull类:
@Injectable()
export class ConfigBull implements SharedBullConfigurationFactory {
constructor(private configService: ConfigService) {}
createSharedConfiguration(): BullModuleOptions {
return {
url: this.configService.get(ConfigServiceCache.CACHE_URL), //# Here i Input rediss url
};
}
}
在我添加作业队列后,redis准备就绪,但没有作业排队或执行并返回超时。
以下是我的Heroku dyno量表:heroku ps:scale web=2 worker=1
我已经尝试了基于Why is @nestjs/bull not able to connect to Heroku Redis?的解决方案,但它不适合我。
1条答案
按热度按时间wz8daaqr1#
尝试在app模块中使用redis url注册Bull: