We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 500e92f commit 9fdc339Copy full SHA for 9fdc339
1 file changed
server/db/connection.ts
@@ -40,7 +40,17 @@ export const chatsDb = new Kysely<ChatsDatabase>({
40
if (!process.env.REDIS_URL) {
41
throw new Error('REDIS_URL is not defined in environment variables');
42
}
43
-export const redisConnection = new Redis(process.env.REDIS_URL as string);
+export const redisConnection = new Redis(process.env.REDIS_URL as string, {
44
+ maxRetriesPerRequest: 3,
45
+});
46
+
47
+redisConnection.on('error', (err) => {
48
+ console.error('[Redis] Connection error:', err.message);
49
50
51
+redisConnection.on('connect', () => {
52
+ console.log('[Redis] Connected successfully');
53
54
55
createMainTables().catch((err) => {
56
console.error('Failed to create main tables:', err);
0 commit comments