Added Error Handling to Cache

This commit is contained in:
Ahmad 2025-01-25 23:55:00 -05:00
parent 5ef2a3c67f
commit 20055c3961
No known key found for this signature in database
GPG key ID: 8FD8A93530D182BF
2 changed files with 45 additions and 21 deletions

13
lib/redis.ts Normal file
View file

@ -0,0 +1,13 @@
import Redis from 'ioredis';
let redis;
if (!redis) {
redis = new Redis(process.env.REDIS_URL);
redis.on('error', (err) => {
console.error('Redis Client Error:', err);
});
}
export default redis;