skip to Main Content

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!

2

Answers


  1. I suggest trying

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

    This fixed the issue for me.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search