This repository has been archived on 2026-01-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blue-ocean/utils/redis.ts
2025-01-25 20:39:55 +01:00

19 lines
437 B
TypeScript

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),
},
});