'Node app not connecting to heroku redis in production
My node app was connecting to heroku redis fine when in development on localhost. When I deployed (I use Heroku for deployment) my app no longer connects to Heroku Redis. My requests that use the redis client are just timing out. Here's my code that connects to Redis.
import Redis from "ioredis";
import dotenv from "dotenv";
dotenv.config();
export const client = new Redis(process.env.REDIS_URL, {
tls: {
rejectUnauthorized: false,
},
});
Then in my controllers I just import { client } from the above connection file. Does anyone know why connection doesn't work in deployment vs development?
Edit: The exact error I'm getting in my heroku logs is - [ioredis] Unhandled error event: Error: connect ETIMEDOUT
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
