From 01b679947cb5f10e898591ce4be36b1e50998c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=90=A6=E6=B6=9B?= Date: Thu, 9 Mar 2023 12:02:07 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90fix=20sonar=E3=80=91DataSourceCachePoo?= =?UTF-8?q?l=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jero/common/util/dynamic/db/DataSourceCachePool.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/dynamic/db/DataSourceCachePool.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/dynamic/db/DataSourceCachePool.java index d46c2317..a206d7a5 100644 --- a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/dynamic/db/DataSourceCachePool.java +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/dynamic/db/DataSourceCachePool.java @@ -38,7 +38,7 @@ public class DataSourceCachePool { */ public static DynamicDataSourceModel getCacheDynamicDataSourceModel(String dbKey) { String redisCacheKey = CacheConstant.SYS_DYNAMICDB_CACHE + dbKey; - if (getRedisTemplate().hasKey(redisCacheKey)) { + if (Boolean.TRUE.equals(getRedisTemplate().hasKey(redisCacheKey))) { return (DynamicDataSourceModel) getRedisTemplate().opsForValue().get(redisCacheKey); } CommonAPI commonAPI = SpringContextUtils.getBean(CommonAPI.class);