chore: Support Redis v6 on Heroku

This commit is contained in:
Tom Moor 2021-09-10 21:05:06 -07:00
parent 92016bbd06
commit 0a998789a3
1 changed files with 7 additions and 0 deletions

View File

@ -7,6 +7,13 @@ const options = {
console.warn(`Retrying redis connection: attempt ${times}`);
return Math.min(times * 100, 3000);
},
// support Heroku Redis, see:
// https://devcenter.heroku.com/articles/heroku-redis#ioredis-module
tls: process.env.REDIS_URL.startsWith("rediss://")
? {
rejectUnauthorized: false,
}
: undefined,
};
const client = new Redis(process.env.REDIS_URL, options);