- Added @t3-oss/env-nextjs for improved environment variable management. - Updated zod to version 4.1.12 for enhanced validation capabilities. - Upgraded jiti to version 2.6.1 for better module loading. - Refactored environment variable imports from env.mjs to env.ts. - Removed deprecated env.mjs file and replaced it with a new env.ts file using @t3-oss/env-nextjs. - Adjusted various components and API routes to utilize the new environment variable structure. - Updated next.config.js to support the new environment variable management. - Modified Docker configuration to align with new BASE_URL handling.
14 lines
263 B
TypeScript
14 lines
263 B
TypeScript
import Redis from "ioredis";
|
|
import { env } from "~/env";
|
|
|
|
let keydb: Redis | null = null;
|
|
|
|
export function getKeydbClient() {
|
|
if (env.SKIP_REDIS === "true") {
|
|
return null;
|
|
}
|
|
if (!keydb) {
|
|
keydb = new Redis(`keydb://${env.KEYDB_URL}`);
|
|
}
|
|
return keydb;
|
|
}
|