🔨 修改 redisson 配置.
This commit is contained in:
@@ -7,6 +7,7 @@ import com.orion.visor.framework.redis.configuration.config.RedissonConfig;
|
||||
import com.orion.visor.framework.redis.core.lock.RedisLocker;
|
||||
import com.orion.visor.framework.redis.core.utils.RedisUtils;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.redisson.config.SingleServerConfig;
|
||||
import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
|
||||
@@ -58,6 +59,9 @@ public class OrionRedisAutoConfiguration {
|
||||
return config -> {
|
||||
config.setThreads(redissonConfig.getThreads());
|
||||
config.setNettyThreads(redissonConfig.getNettyThreads());
|
||||
// 单机配置
|
||||
SingleServerConfig single = config.useSingleServer();
|
||||
single.setConnectionMinimumIdleSize(redissonConfig.getMinimumIdleSize());
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -24,9 +24,15 @@ public class RedissonConfig {
|
||||
*/
|
||||
private Integer nettyThreads;
|
||||
|
||||
/**
|
||||
* 最小空闲连接数
|
||||
*/
|
||||
private Integer minimumIdleSize;
|
||||
|
||||
public RedissonConfig() {
|
||||
this.threads = 16;
|
||||
this.nettyThreads = 16;
|
||||
this.minimumIdleSize = 16;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,12 @@
|
||||
"type": "java.lang.Integer",
|
||||
"description": "netty 线程数.",
|
||||
"defaultValue": "16"
|
||||
},
|
||||
{
|
||||
"name": "spring.redisson.minimum-idle-size",
|
||||
"type": "java.lang.Integer",
|
||||
"description": "最小空闲连接数.",
|
||||
"defaultValue": "16"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user