Merge branch 'master' of github.com:redisson/redisson

pull/1730/head
Nikita Koksharov 6 years ago
commit 1ab6ebf38a

@ -74,7 +74,9 @@ public class RedissonAutoConfiguration {
Method timeoutMethod = ReflectionUtils.findMethod(RedisProperties.class, "getTimeout"); Method timeoutMethod = ReflectionUtils.findMethod(RedisProperties.class, "getTimeout");
Object timeoutValue = ReflectionUtils.invokeMethod(timeoutMethod, redisProperties); Object timeoutValue = ReflectionUtils.invokeMethod(timeoutMethod, redisProperties);
int timeout; int timeout;
if (!(timeoutValue instanceof Integer)) { if(null == timeoutValue){
timeout = 0;
}else if (!(timeoutValue instanceof Integer)) {
Method millisMethod = ReflectionUtils.findMethod(timeoutValue.getClass(), "toMillis"); Method millisMethod = ReflectionUtils.findMethod(timeoutValue.getClass(), "toMillis");
timeout = ((Long) ReflectionUtils.invokeMethod(millisMethod, timeoutValue)).intValue(); timeout = ((Long) ReflectionUtils.invokeMethod(millisMethod, timeoutValue)).intValue();
} else { } else {

@ -371,8 +371,11 @@ public class SentinelConnectionManager extends MasterSlaveConnectionManager {
Set<String> removedSlaves = new HashSet<String>(slaves); Set<String> removedSlaves = new HashSet<String>(slaves);
removedSlaves.removeAll(currentSlaves); removedSlaves.removeAll(currentSlaves);
for (String slave : removedSlaves) { for (String slave : removedSlaves) {
String[] parts = slave.replace("redis://", "").split(":"); String hostPort = slave.replace("redis://", "");
slaveDown(parts[0], parts[1]); int lastColonIdx = hostPort.lastIndexOf(":");
String host = hostPort.substring(0, lastColonIdx);
String port = hostPort.substring(lastColonIdx + 1);
slaveDown(host, port);
} }
}; };
}; };

Loading…
Cancel
Save