github debug

This commit is contained in:
Igor Loskutov
2025-09-04 21:58:06 -04:00
parent 9453ebe356
commit 988586ee42
6 changed files with 6 additions and 47 deletions

View File

@@ -1,5 +1,4 @@
import Redis from "ioredis";
import { isBuildPhase } from "./next";
export type RedisClient = Pick<Redis, "get" | "setex" | "del">;
@@ -27,20 +26,4 @@ const getRedisClient = (): RedisClient => {
return redis;
};
// 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();
export const tokenCacheRedis = getRedisClient();