diff --git a/backend/src/routes/health.ts b/backend/src/routes/health.ts index 8c9653ac..39380fe3 100644 --- a/backend/src/routes/health.ts +++ b/backend/src/routes/health.ts @@ -138,14 +138,16 @@ async function getDbHealth(): Promise { async function getRedisHealth(): Promise { const start = Date.now(); + const isLocal = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'local' || !process.env.NODE_ENV; // Check if Redis is configured if (!process.env.REDIS_URL && !process.env.REDIS_HOST) { + // Redis is optional in local dev, required in prod/staging return { - status: 'ok', // Redis is optional + status: isLocal ? 'ok' : 'error', connected: false, latency_ms: 0, - error: 'Redis not configured', + error: isLocal ? 'Redis not configured (optional in local)' : 'Redis not configured (required in production)', }; }