tasko/lib/redis.ts

14 lines
232 B
TypeScript
Raw Permalink Normal View History

2025-01-26 04:55:00 +00:00
import Redis from 'ioredis';
2025-01-26 05:11:30 +00:00
let redis: Redis | null = null;
2025-01-26 04:55:00 +00:00
if (!redis) {
redis = new Redis(process.env.REDIS_URL!);
2025-01-26 04:55:00 +00:00
redis.on('error', (err) => {
console.error('Redis Client Error:', err);
});
}
export default redis;