fix: health.php Redis fallo no marca app como unhealthy

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).
This commit is contained in:
Lizandro Guarnizo
2026-03-12 16:22:43 -05:00
parent 2a50a5e1d4
commit 9571b2677a
+3 -3
View File
@@ -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