|
|
@ -129,6 +129,7 @@ public class RedissonAutoConfiguration {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("MethodLength")
|
|
|
|
@Bean(destroyMethod = "shutdown")
|
|
|
|
@Bean(destroyMethod = "shutdown")
|
|
|
|
@ConditionalOnMissingBean(RedissonClient.class)
|
|
|
|
@ConditionalOnMissingBean(RedissonClient.class)
|
|
|
|
public RedissonClient redisson() throws IOException {
|
|
|
|
public RedissonClient redisson() throws IOException {
|
|
|
@ -167,7 +168,7 @@ public class RedissonAutoConfiguration {
|
|
|
|
if (timeoutValue instanceof Duration) {
|
|
|
|
if (timeoutValue instanceof Duration) {
|
|
|
|
timeout = (int) ((Duration) timeoutValue).toMillis();
|
|
|
|
timeout = (int) ((Duration) timeoutValue).toMillis();
|
|
|
|
} else if (timeoutValue != null){
|
|
|
|
} else if (timeoutValue != null){
|
|
|
|
timeout = (Integer)timeoutValue;
|
|
|
|
timeout = (Integer) timeoutValue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Integer connectTimeout = null;
|
|
|
|
Integer connectTimeout = null;
|
|
|
@ -222,9 +223,9 @@ public class RedissonAutoConfiguration {
|
|
|
|
Method nodesMethod = ReflectionUtils.findMethod(Sentinel.class, "getNodes");
|
|
|
|
Method nodesMethod = ReflectionUtils.findMethod(Sentinel.class, "getNodes");
|
|
|
|
Object nodesValue = ReflectionUtils.invokeMethod(nodesMethod, redisProperties.getSentinel());
|
|
|
|
Object nodesValue = ReflectionUtils.invokeMethod(nodesMethod, redisProperties.getSentinel());
|
|
|
|
if (nodesValue instanceof String) {
|
|
|
|
if (nodesValue instanceof String) {
|
|
|
|
nodes = convert(prefix, Arrays.asList(((String)nodesValue).split(",")));
|
|
|
|
nodes = convert(prefix, Arrays.asList(((String) nodesValue).split(",")));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
nodes = convert(prefix, (List<String>)nodesValue);
|
|
|
|
nodes = convert(prefix, (List<String>) nodesValue);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sentinelMaster = redisProperties.getSentinel().getMaster();
|
|
|
|
sentinelMaster = redisProperties.getSentinel().getMaster();
|
|
|
|
}
|
|
|
|
}
|
|
|
|