0

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

julian corredor
  • 103
  • 2
  • 13

1 Answers1

0

I understand that it does not work properly in a different environment. In this case, first of all, you need to check if the Redis version used locally and the Redis version used on Heroku are the same. Let's check this first.

papa-mon
  • 1
  • 2