1

This works for local redis-server

BullModule.forRoot({
    redis: {
        host: "localhost",
        port: 6379,
        db: 0,
        password: ""
    }
})

But if I use the DataStore Credentials on Heroku Redis, the bull board does not load and Heroku Logs gives an H12 error.

enter image description here

How can I get the BullModule to properly connect to Heroku Data for Redis?

Thanks!

NovemberSpawn
  • 73
  • 1
  • 6

2 Answers2

1

You must specify the location of where redis is accessible. localhost:6379 is the default for running redis locally, but to deploy an application that uses Redis to Heroku, you will need to add the Connecting to Heroku Data for Redis add-on. Then, you'll need to pass the location of your Redis service via process.env.REDIS_URL to the BullModule.forRoot() constructor.

Be aware that encountering TLS issues in connecting to Redis like this are common. When I tried connecting using the format from PedroPovedaQ's answer, I ran into one. There's a discusson on that here.

Jameson
  • 51
  • 1
0

I suggest trying

BullModule.forRoot({
    redis: "<redisurl given by heroku in env variable>"
})

This fixed the issue for me.

PedroPovedaQ
  • 97
  • 2
  • 9