fix: add admin

This commit is contained in:
2026-02-14 10:14:49 +01:00
parent 2e02d6d763
commit f2b690f3f5
86 changed files with 1057 additions and 1939 deletions

24
server/utils/redis.ts Normal file
View File

@@ -0,0 +1,24 @@
import Redis from "ioredis";
let redis: Redis | null = null;
function getRedisUrl(): string {
return useRuntimeConfig().redisUrl || "redis://localhost:6379";
}
export function getRedis(): Redis {
if (redis) return redis;
redis = new Redis(getRedisUrl(), { maxRetriesPerRequest: null });
return redis;
}
export function createRedisClient(): Redis {
return new Redis(getRedisUrl(), { maxRetriesPerRequest: null });
}
export async function closeRedis(): Promise<void> {
if (redis) {
await redis.quit();
redis = null;
}
}