From 120bf9d788a9959edae5417e3fea5b8cefffca02 Mon Sep 17 00:00:00 2001 From: remm Date: Fri, 11 Sep 2020 15:54:57 +0200 Subject: [PATCH] Implement checkContainersAvailable flag --- java/org/apache/catalina/valves/HealthCheckValve.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/org/apache/catalina/valves/HealthCheckValve.java b/java/org/apache/catalina/valves/HealthCheckValve.java index c111b3b9b8d4..3dd9becff1a7 100644 --- a/java/org/apache/catalina/valves/HealthCheckValve.java +++ b/java/org/apache/catalina/valves/HealthCheckValve.java @@ -96,7 +96,7 @@ public void invoke(Request request, Response response) context ? request.getRequestPathMB() : request.getDecodedRequestURIMB(); if (urlMB.equals(path)) { response.setContentType("application/json"); - if (isAvailable(getContainer())) { + if (!checkContainersAvailable || (checkContainersAvailable && isAvailable(getContainer()))) { response.getOutputStream().print(UP); } else { response.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);