Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ public RedisClusterJedisProvider(HostSupplier hostSupplier){
public JedisCommands get() {
// FIXME This doesn't seem very safe, but is how it was in the code this was moved from.
Host host = new ArrayList<Host>(hostSupplier.getHosts()).get(0);
String password = host.getPassword();
GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
poolConfig.setMinIdle(5);
poolConfig.setMaxTotal(1000);
return new JedisCluster(new HostAndPort(host.getHostName(), host.getPort()), poolConfig);
if (password.length() == 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using StringUtils.isNotBlank to null check.

return new JedisCluster(new HostAndPort(host.getHostName(), host.getPort()), poolConfig);
} else {
return new JedisCluster(new HostAndPort(host.getHostName(), host.getPort()), 100000, 100000,
3, password, poolConfig);
}
}
}