I am using NestJS alongside bull to process queues that get added by a cron and manually through a GET call on a service. It all works fine on my docker development in the local machine, but, if I connect the local nestJS to the redis instance on heroku, the queues do not work properly. Only some items get processed and, if I upload everything to heroku it's way worse because it does not process anything at all.
Here's my config:
BullModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
async useFactory(configService: ConfigService) {
return {
redis: getRedisConfiguration(configService),
};
},
}),
export const getRedisConfiguration = (configService: ConfigService) => {
const redisUrl = configService.get('REDIS_URL');
if (redisUrl) {
const parsedUrl = new URL(redisUrl);
return {
host: parsedUrl.hostname,
password: parsedUrl.password,
port: Number(parsedUrl.port),
};
}
return {
host: configService.get<string>('REDIS_HOST'),
port: Number(configService.get<string>('REDIS_PORT')),
};
};
I've also tried using REDIS_TLS_URL
but the result is the same, been at this for days and I do not know what else to try