From d1fb2e19d364c68ca109d83e57186fda5777ad2e Mon Sep 17 00:00:00 2001 From: Owen Date: Thu, 21 May 2026 14:43:50 -0700 Subject: [PATCH] Fix cache import to be dynamic --- server/lib/cache.ts | 11 +++++++++++ server/lib/statusHistory.ts | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/server/lib/cache.ts b/server/lib/cache.ts index f089a6387..498d0dd3f 100644 --- a/server/lib/cache.ts +++ b/server/lib/cache.ts @@ -154,8 +154,19 @@ class AdaptiveCache { keys(): string[] { return localCache.keys(); } + + /** + * Get keys with a specific prefix + * @param prefix - Key prefix to match + * @returns Array of matching keys + */ + async keysWithPrefix(prefix: string): Promise { + const allKeys = localCache.keys(); + return allKeys.filter((key) => key.startsWith(prefix)); + } } // Export singleton instance export const cache = new AdaptiveCache(); +export const regionalCache = cache; // Alias for compatability with the private version export default cache; diff --git a/server/lib/statusHistory.ts b/server/lib/statusHistory.ts index 93e74ced3..8bb7e6a0c 100644 --- a/server/lib/statusHistory.ts +++ b/server/lib/statusHistory.ts @@ -1,7 +1,7 @@ import { z } from "zod"; import { db, logsDb, statusHistory } from "@server/db"; import { and, eq, gte, asc } from "drizzle-orm"; -import { regionalCache as cache } from "@server/private/lib/cache"; +import { regionalCache as cache } from "#dynamic/lib/cache"; const STATUS_HISTORY_CACHE_TTL = 60; // seconds