From 27e9bc4a2fbb4851283e6044fe07ab928e11d338 Mon Sep 17 00:00:00 2001 From: ycl Date: Tue, 14 Oct 2025 17:39:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20template/common/src/main/j?= =?UTF-8?q?ava/{{.packagePath}}/common/redis/RedisPoolConfig.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/{{.packagePath}}/common/redis/RedisPoolConfig.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/template/common/src/main/java/{{.packagePath}}/common/redis/RedisPoolConfig.java b/template/common/src/main/java/{{.packagePath}}/common/redis/RedisPoolConfig.java index 5630917..c8ca955 100644 --- a/template/common/src/main/java/{{.packagePath}}/common/redis/RedisPoolConfig.java +++ b/template/common/src/main/java/{{.packagePath}}/common/redis/RedisPoolConfig.java @@ -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));