|
|
|
@ -37,8 +37,8 @@ public class JedisSupport {
|
|
|
|
if (config.shards.contains(",")) {
|
|
|
|
if (config.shards.contains(",")) {
|
|
|
|
List<JedisShardInfo> jedisShards = Arrays.stream(config.shards.split(",")).map(uri -> {
|
|
|
|
List<JedisShardInfo> jedisShards = Arrays.stream(config.shards.split(",")).map(uri -> {
|
|
|
|
JedisShardInfo jedisShardInfo = new JedisShardInfo(URI.create(uri));
|
|
|
|
JedisShardInfo jedisShardInfo = new JedisShardInfo(URI.create(uri));
|
|
|
|
if (config.password.length() > 0) {
|
|
|
|
if (config.password.isPresent()) {
|
|
|
|
jedisShardInfo.setPassword(config.password);
|
|
|
|
jedisShardInfo.setPassword(config.password.get());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return jedisShardInfo;
|
|
|
|
return jedisShardInfo;
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
@ -46,9 +46,9 @@ public class JedisSupport {
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
URI server = URI.create(config.shards);
|
|
|
|
URI server = URI.create(config.shards);
|
|
|
|
if (config.password.length() > 0) {
|
|
|
|
if (config.password.isPresent()) {
|
|
|
|
this.jedisPool = new JedisPool(poolConfig, server.getHost(), server.getPort(), Protocol.DEFAULT_TIMEOUT,
|
|
|
|
this.jedisPool = new JedisPool(poolConfig, server.getHost(), server.getPort(), Protocol.DEFAULT_TIMEOUT,
|
|
|
|
config.password);
|
|
|
|
config.password.get());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.jedisPool = new JedisPool(poolConfig, server);
|
|
|
|
this.jedisPool = new JedisPool(poolConfig, server);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|