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