feat: move from upstash to redis
Some checks failed
Deploy / lint-build-deploy (push) Failing after 2m35s

This commit is contained in:
2026-01-19 18:55:22 +01:00
parent 77b9391c6d
commit be467f7403
9 changed files with 961 additions and 768 deletions

View File

@@ -1,18 +1,11 @@
import { Redis } from '@upstash/redis';
import Redis from 'ioredis';
if (!process.env.KV_REST_API_URL) {
throw new Error('KV_REST_API_URL is not defined');
}
if (!process.env.KV_REST_API_TOKEN) {
throw new Error('KV_REST_API_TOKEN is not defined');
}
const redisHost = process.env.REDIS_HOST || 'localhost';
const redisPort = parseInt(process.env.REDIS_PORT || '6379', 10);
export const redis = new Redis({
url: process.env.KV_REST_API_URL,
token: process.env.KV_REST_API_TOKEN,
retry: {
retries: 3,
backoff: (retryCount) => Math.min(retryCount * 100, 3000),
},
host: redisHost,
port: redisPort,
maxRetriesPerRequest: 3,
retryStrategy: (times) => Math.min(times * 100, 3000),
});