更新 template/common/src/main/java/{{.packagePath}}/common/redis/RedisPoolConfig.java
This commit is contained in:
@@ -30,6 +30,7 @@ public class RedisPoolConfig {
|
||||
* @return JedisPoolConfig
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "redis-config.pool",name = "hostAndPort")
|
||||
public JedisPoolConfig initPoolConfig() {
|
||||
JedisPoolConfig poolConfig = new JedisPoolConfig();
|
||||
// 设置最大连接数,默认值为8.如果赋值为-1,则表示不限制;
|
||||
@@ -85,6 +86,7 @@ public class RedisPoolConfig {
|
||||
* @return 返回redis连接池,
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "redis-config.pool",name = "hostAndPort")
|
||||
public JedisPool getRedisPool() {
|
||||
String host = StrUtil.subBefore(redisPoolProperties.getHostAndPort(), ":", false);
|
||||
int port = Integer.parseInt(StrUtil.subAfter(redisPoolProperties.getHostAndPort(), ":", false));
|
||||
|
||||
Reference in New Issue
Block a user