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:
+3
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user