Move to a synchronous, pooled connection model for Redis clusters.

This commit is contained in:
Jon Chambers
2020-08-14 12:19:27 -04:00
committed by Jon Chambers
parent 27f721a1f5
commit 6fb9038af1
6 changed files with 95 additions and 58 deletions

View File

@@ -14,10 +14,8 @@ public class RedisClusterHealthCheck extends HealthCheck {
}
@Override
protected Result check() throws Exception {
return CompletableFuture.allOf(redisCluster.withCluster(connection -> connection.async().masters().commands().ping()).futures())
.thenApply(v -> Result.healthy())
.exceptionally(Result::unhealthy)
.get();
protected Result check() {
redisCluster.withCluster(connection -> connection.sync().masters().commands().ping());
return Result.healthy();
}
}