From 9571b2677a18fbb349a1480b7e61c8b3ee53c818 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Thu, 12 Mar 2026 16:22:43 -0500 Subject: [PATCH] fix: health.php Redis fallo no marca app como unhealthy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Redis es infraestructura opcional — si falla la conexión, retorna 'warning' en lugar de 'unhealthy', evitando que Traefik muestre 'no available server'. Solo DB down debe marcar el app como unhealthy (es crítico). --- health.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/health.php b/health.php index e7f540c..ea8ff76 100644 --- a/health.php +++ b/health.php @@ -52,15 +52,15 @@ try { $ping = $redis->ping(); $health['checks']['redis'] = [ - 'status' => ((string)$ping === 'PONG' || $ping === true) ? 'ok' : 'error', + 'status' => ((string)$ping === 'PONG' || $ping === true) ? 'ok' : 'warning', 'host' => getenv('REDIS_HOST') ?: '127.0.0.1' ]; } catch (Exception $e) { + // Redis es opcional — no marcar el app como unhealthy si Redis falla $health['checks']['redis'] = [ - 'status' => 'error', + 'status' => 'warning', 'error' => $e->getMessage() ]; - $health['status'] = 'unhealthy'; } // 4. Check logs directory