@@ -266,18 +266,16 @@ protected Pool<Jedis> createRedisSentinelPool(RedisSentinelConfiguration config)
266
266
*/
267
267
protected Pool <Jedis > createRedisPool () {
268
268
269
- return useSsl
270
- ? new JedisPool (getPoolConfig (), getShardInfo ().getHost (), getShardInfo ().getPort (),
271
- getTimeoutFrom (getShardInfo ()), getShardInfo ().getPassword (), true )
272
- : new JedisPool (getPoolConfig (), getShardInfo ().getHost (), getShardInfo ().getPort (),
273
- getTimeoutFrom (getShardInfo ()), getShardInfo ().getPassword ());
269
+ return new JedisPool (getPoolConfig (), getShardInfo ().getHost (), getShardInfo ().getPort (),
270
+ getTimeoutFrom (getShardInfo ()), getShardInfo ().getPassword (), useSsl );
274
271
}
275
272
276
273
private JedisCluster createCluster () {
277
274
278
275
JedisCluster cluster = createCluster (this .clusterConfig , this .poolConfig );
279
- this .clusterCommandExecutor = new ClusterCommandExecutor (new JedisClusterConnection .JedisClusterTopologyProvider (
280
- cluster ), new JedisClusterConnection .JedisClusterNodeResourceProvider (cluster ), EXCEPTION_TRANSLATION );
276
+ this .clusterCommandExecutor = new ClusterCommandExecutor (
277
+ new JedisClusterConnection .JedisClusterTopologyProvider (cluster ),
278
+ new JedisClusterConnection .JedisClusterNodeResourceProvider (cluster ), EXCEPTION_TRANSLATION );
281
279
return cluster ;
282
280
}
283
281
@@ -300,14 +298,8 @@ protected JedisCluster createCluster(RedisClusterConfiguration clusterConfig, Ge
300
298
301
299
int redirects = clusterConfig .getMaxRedirects () != null ? clusterConfig .getMaxRedirects ().intValue () : 5 ;
302
300
303
- if (poolConfig != null ) {
304
- return StringUtils .hasText (getPassword ())
305
- ? new JedisCluster (hostAndPort , timeout , timeout , redirects , getPassword (), poolConfig )
306
- : new JedisCluster (hostAndPort , timeout , redirects , poolConfig );
307
- }
308
-
309
301
return StringUtils .hasText (getPassword ())
310
- ? new JedisCluster (hostAndPort , timeout , timeout , redirects , getPassword () , poolConfig )
302
+ ? new JedisCluster (hostAndPort , timeout , timeout , redirects , password , poolConfig )
311
303
: new JedisCluster (hostAndPort , timeout , redirects , poolConfig );
312
304
}
313
305
@@ -349,8 +341,8 @@ public RedisConnection getConnection() {
349
341
}
350
342
351
343
Jedis jedis = fetchJedisConnector ();
352
- JedisConnection connection = (usePool ? new JedisConnection (jedis , pool , dbIndex ) : new JedisConnection ( jedis ,
353
- null , dbIndex ));
344
+ JedisConnection connection = (usePool ? new JedisConnection (jedis , pool , dbIndex )
345
+ : new JedisConnection ( jedis , null , dbIndex ));
354
346
connection .setConvertPipelineAndTxResults (convertPipelineAndTxResults );
355
347
return postProcessConnection (connection );
356
348
}
0 commit comments