Enhance health check logic to allow partial database failures without throwing an error, improving resilience in environments with multiple databases.

This commit is contained in:
shimon 2025-12-01 13:40:34 +02:00
parent 22c90ca7ad
commit 2dfa7d9542

View file

@ -136,7 +136,9 @@ App::get('/v1/health/db')
}
}
if (!empty($failures)) {
// Only throw error if ALL databases failed (no successful pings)
// This allows partial failures in environments where not all DBs are ready
if (!empty($failures) && empty($output)) {
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'DB failure on: ' . implode(", ", $failures));
}