mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
15 lines
385 B
JavaScript
15 lines
385 B
JavaScript
|
|
const KeyvRedis = require('@keyv/redis');
|
||
|
|
|
||
|
|
const { REDIS_URI } = process.env;
|
||
|
|
|
||
|
|
let keyvRedis;
|
||
|
|
|
||
|
|
if (REDIS_URI) {
|
||
|
|
keyvRedis = new KeyvRedis(REDIS_URI, { useRedisSets: false });
|
||
|
|
keyvRedis.on('error', (err) => console.error('KeyvRedis connection error:', err));
|
||
|
|
} else {
|
||
|
|
// console.log('REDIS_URI not provided. Redis module will not be initialized.');
|
||
|
|
}
|
||
|
|
|
||
|
|
module.exports = keyvRedis;
|