Skip to content

Commit

Permalink
[java] close the httpclient after checking the service status #13643
Browse files Browse the repository at this point in the history
  • Loading branch information
joerg1985 committed Mar 4, 2024
1 parent c0711e2 commit 1cfe991
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ public boolean isServiceUp() {
// If no status endpoint was configured, we assume the server is up.
return true;
}
try {
HttpClient client = clientFactory.createClient(serviceStatusUrl);
try (HttpClient client = clientFactory.createClient(serviceStatusUrl)) {
HttpResponse response =
client.execute(new HttpRequest(HttpMethod.GET, serviceStatusUrl.toString()));
LOG.log(Debug.getDebugLogLevel(), () -> Contents.string(response));
Expand Down

0 comments on commit 1cfe991

Please sign in to comment.