diff --git a/src/app/api/beatsaver/mapdata/route.ts b/src/app/api/beatsaver/mapdata/route.ts index 821beea..8a8c85d 100644 --- a/src/app/api/beatsaver/mapdata/route.ts +++ b/src/app/api/beatsaver/mapdata/route.ts @@ -2,8 +2,6 @@ import { Redis } from "@/db/redis"; import { BeatsaverMap } from "@/schemas/beatsaver/BeatsaverMap"; import { BeatsaverAPI } from "@/utils/beatsaver/api"; -await Redis.connectRedis(); - export async function GET(request: Request) { const { searchParams } = new URL(request.url); const mapHashes = searchParams.get("hashes")?.split(",") ?? undefined; diff --git a/src/db/redis.ts b/src/db/redis.ts index 23c96e9..608a12c 100644 --- a/src/db/redis.ts +++ b/src/db/redis.ts @@ -1,8 +1,8 @@ import { createClient } from "redis"; -let redisClient = connectRedis(); +let redisClient = await connectRedis(); -async function connectRedis() { +async function connectRedis(): Promise { console.log("Connecting to redis"); const client = createClient({ url: process.env.REDIS_URL,