From c08a8d0cc069fdbcd7fce77acf2f80ef4e3115ec Mon Sep 17 00:00:00 2001 From: Igor Loskutov Date: Thu, 4 Sep 2025 22:03:52 -0400 Subject: [PATCH] CI debug --- www/app/lib/redisClient.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/www/app/lib/redisClient.ts b/www/app/lib/redisClient.ts index c85c0e9e..1be36538 100644 --- a/www/app/lib/redisClient.ts +++ b/www/app/lib/redisClient.ts @@ -1,4 +1,5 @@ import Redis from "ioredis"; +import { isBuildPhase } from "./next"; export type RedisClient = Pick; @@ -26,4 +27,20 @@ const getRedisClient = (): RedisClient => { return redis; }; -export const tokenCacheRedis = getRedisClient(); +// next.js buildtime usage - we want to isolate next.js "build" time concepts here +const noopClient: RedisClient = (() => { + const noopSetex: Redis["setex"] = async () => { + return "OK" as const; + }; + const noopDel: Redis["del"] = async () => { + return 0; + }; + return { + get: async () => { + return null; + }, + setex: noopSetex, + del: noopDel, + }; +})(); +export const tokenCacheRedis = isBuildPhase ? noopClient : getRedisClient();