aboutsummaryrefslogtreecommitdiff
path: root/lib/redis.js
blob: ed8b8c5638077c1dd843266be8c34ebe7b8f0171 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { Redis } from "ioredis";

const REDIS_URL = process.env.REDIS_URL;

let redis;

if (REDIS_URL) {
  redis = new Redis(REDIS_URL);
} else {
  console.warn("REDIS_URL is not defined. Redis caching will be disabled.");
}

export default redis;