Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix: redis connection string with bull (#2410)

Max Deichmann1aeb79b913cf
diff --git a/worker/src/env.ts b/worker/src/env.ts
index e0356428f2..9f5139bb01 100644
--- a/worker/src/env.ts
+++ b/worker/src/env.ts
@@ -14,7 +14,7 @@ const EnvSchema = z.object({
.positive()
.max(65536, `options.port should be >= 0 and < 65536`)
.default(3030),
- REDIS_HOST: z.string(),
+ REDIS_HOST: z.string().nullish(),
REDIS_PORT: z.coerce
.number({
description:
@@ -22,9 +22,10 @@ const EnvSchema = z.object({
})
.positive()
.max(65536, `options.port should be >= 0 and < 65536`)
- .default(6379),
- REDIS_AUTH: z.string(),
- REDIS_CONNECTION_STRING: z.string().optional(),
+ .default(6379)
+ .nullable(),
+ REDIS_AUTH: z.string().nullish(),
+ REDIS_CONNECTION_STRING: z.string().nullish(),
LANGFUSE_WORKER_PASSWORD: z.string(),
S3_ACCESS_KEY_ID: z.string().optional(),
S3_SECRET_ACCESS_KEY: z.string().optional(),
diff --git a/worker/src/redis.ts b/worker/src/redis.ts
index 945f843829..f64b59d187 100644
--- a/worker/src/redis.ts
+++ b/worker/src/redis.ts
@@ -5,11 +5,11 @@ import logger from "./logger";
const createRedisClient = () => {
try {
return env.REDIS_CONNECTION_STRING
- ? new Redis(env.REDIS_CONNECTION_STRING)
+ ? new Redis(env.REDIS_CONNECTION_STRING, { maxRetriesPerRequest: null })
: new Redis({
- host: env.REDIS_HOST,
- port: env.REDIS_PORT,
- password: env.REDIS_AUTH,
+ host: String(env.REDIS_HOST),
+ port: Number(env.REDIS_PORT),
+ password: String(env.REDIS_AUTH),
maxRetriesPerRequest: null, // Set to `null` to disable retrying
});
} catch (e) {