feat: add redis integration and environment variables

This commit is contained in:
2026-06-16 13:10:47 +03:00
parent 76af0683fd
commit 2206a3fe39
3 changed files with 86 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
import Redis from 'ioredis'
const globalForRedis = global as unknown as { redis: Redis }
export const redis =
globalForRedis.redis ||
new Redis(process.env.REDIS_URL || 'redis://localhost:6379', {
maxRetriesPerRequest: null,
})
if (process.env.NODE_ENV !== 'production') globalForRedis.redis = redis