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

13 lines
239 B
TypeScript

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