You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
filepizza/src/redisClient.ts

15 lines
277 B
TypeScript

import Redis from 'ioredis'
export { Redis }
let redisClient: Redis | null = null
export function getRedisClient(): Redis {
if (!redisClient) {
redisClient = process.env.REDIS_URL
? new Redis(process.env.REDIS_URL)
: new Redis()
}
return redisClient
}