From 4a47e4b93f62b5e636ac0e76f3e4ee98e2b83154 Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期五, 02 八月 2024 08:32:55 +0800 Subject: [PATCH] 1、全局配置文件修改 2、工作流bpm功能修改 --- iailab-framework/iailab-common-biz-tenant/src/main/java/com/iailab/framework/tenant/core/redis/TenantRedisCacheManager.java | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/iailab-framework/iailab-common-biz-tenant/src/main/java/com/iailab/framework/tenant/core/redis/TenantRedisCacheManager.java b/iailab-framework/iailab-common-biz-tenant/src/main/java/com/iailab/framework/tenant/core/redis/TenantRedisCacheManager.java index 00d821d..9394cf2 100644 --- a/iailab-framework/iailab-common-biz-tenant/src/main/java/com/iailab/framework/tenant/core/redis/TenantRedisCacheManager.java +++ b/iailab-framework/iailab-common-biz-tenant/src/main/java/com/iailab/framework/tenant/core/redis/TenantRedisCacheManager.java @@ -1,5 +1,6 @@ package com.iailab.framework.tenant.core.redis; +import cn.hutool.core.collection.CollUtil; import com.iailab.framework.redis.core.TimeoutRedisCacheManager; import com.iailab.framework.tenant.core.context.TenantContextHolder; import lombok.extern.slf4j.Slf4j; @@ -7,6 +8,8 @@ import org.springframework.data.redis.cache.RedisCacheConfiguration; import org.springframework.data.redis.cache.RedisCacheManager; import org.springframework.data.redis.cache.RedisCacheWriter; + +import java.util.Set; /** * 多租户的 {@link RedisCacheManager} 实现类 @@ -18,16 +21,21 @@ @Slf4j public class TenantRedisCacheManager extends TimeoutRedisCacheManager { + private final Set<String> ignoreCaches; + public TenantRedisCacheManager(RedisCacheWriter cacheWriter, - RedisCacheConfiguration defaultCacheConfiguration) { + RedisCacheConfiguration defaultCacheConfiguration, + Set<String> ignoreCaches) { super(cacheWriter, defaultCacheConfiguration); + this.ignoreCaches = ignoreCaches; } @Override public Cache getCache(String name) { // 如果开启多租户,则 name 拼接租户后缀 if (!TenantContextHolder.isIgnore() - && TenantContextHolder.getTenantId() != null) { + && TenantContextHolder.getTenantId() != null + && !CollUtil.contains(ignoreCaches, name)) { name = name + ":" + TenantContextHolder.getTenantId(); } -- Gitblit v1.9.3