Skip to content

Commit

Permalink
chore: log when failed to check health
Browse files Browse the repository at this point in the history
  • Loading branch information
fengjiachun committed Oct 23, 2024
1 parent 6ab5859 commit 06d0caf
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,11 @@ private CompletableFuture<Boolean> doCheckHealth(Endpoint endpoint) {
HealthCheckRequest req = HealthCheckRequest.newBuilder().build();
return invoke(endpoint, req, Context.newDefault(), this.opts.getCheckHealthTimeoutMs())
.thenApply(resp -> true)
.exceptionally(t -> false); // Handle failure and return false
.exceptionally(
t -> { // Handle failure and return false
LOG.warn("Failed to check health for endpoint: {}", endpoint, t);
return false;
});
}

/**
Expand Down

0 comments on commit 06d0caf

Please sign in to comment.