diff --git a/src/config.ts b/src/config.ts index 0e38904..735ff09 100644 --- a/src/config.ts +++ b/src/config.ts @@ -48,11 +48,10 @@ export class Config { * and returns undefined, allowing RAG CHAT to fall back to using an in-memory database. */ const initializeRedis = () => { - try { - return Redis.fromEnv(); - } catch { - return; - } + const environment = typeof process === "undefined" ? ({} as Record) : process.env; + return environment.UPSTASH_REDIS_REST_URL && environment.UPSTASH_REDIS_REST_TOKEN + ? Redis.fromEnv() + : undefined; }; /** diff --git a/tsup.config.ts b/tsup.config.ts index 1798cbf..ce556b0 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -4,7 +4,6 @@ export default defineConfig([ entry: ["src/index.ts"], outDir: "dist", format: ["cjs", "esm"], - clean: true, dts: true, }, {