mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-05-04 04:33:10 +00:00
Added Error Handling to Cache
This commit is contained in:
parent
5ef2a3c67f
commit
20055c3961
2 changed files with 45 additions and 21 deletions
13
lib/redis.ts
Normal file
13
lib/redis.ts
Normal 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;
|
Loading…
Add table
Add a link
Reference in a new issue