feat: first draft

This commit is contained in:
2025-01-25 20:39:55 +01:00
parent 78c69dbc1a
commit 06fbbab24d
53 changed files with 13416 additions and 123 deletions

18
utils/redis.ts Normal file
View File

@@ -0,0 +1,18 @@
import { Redis } from '@upstash/redis';
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');
}
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),
},
});