From ac851980a71bb3dc23496dc9777ba002b380bf9c Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Wed, 14 Jul 2021 11:49:09 +0600 Subject: [PATCH] Fix Sentinel constructor (#2574) --- src/main/java/redis/clients/jedis/JedisSentinelPool.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/redis/clients/jedis/JedisSentinelPool.java b/src/main/java/redis/clients/jedis/JedisSentinelPool.java index 5d8ff75d0e..06e438fbd8 100644 --- a/src/main/java/redis/clients/jedis/JedisSentinelPool.java +++ b/src/main/java/redis/clients/jedis/JedisSentinelPool.java @@ -166,7 +166,14 @@ public JedisSentinelPool(String masterName, Set sentinels, final String user, final String password, final int database, final String clientName, final int sentinelConnectionTimeout, final int sentinelSoTimeout, final String sentinelUser, final String sentinelPassword, final String sentinelClientName) { - this(masterName, sentinels, poolConfig, new JedisFactory(connectionTimeout, soTimeout, infiniteSoTimeout, user, password, database, clientName)); + this(masterName, parseHostAndPorts(sentinels), poolConfig, + DefaultJedisClientConfig.builder().connectionTimeoutMillis(connectionTimeout) + .socketTimeoutMillis(soTimeout).blockingSocketTimeoutMillis(infiniteSoTimeout) + .user(user).password(password).database(database).clientName(clientName).build(), + DefaultJedisClientConfig.builder().connectionTimeoutMillis(sentinelConnectionTimeout) + .socketTimeoutMillis(sentinelSoTimeout).user(sentinelUser).password(sentinelPassword) + .clientName(sentinelClientName).build() + ); this.connectionTimeout = connectionTimeout; this.soTimeout = soTimeout; this.infiniteSoTimeout = infiniteSoTimeout;