| | |
| | | @Primary // 引入租户时,tenantRedisCacheManager 为主 Bean |
| | | public RedisCacheManager tenantRedisCacheManager(RedisTemplate<String, Object> redisTemplate, |
| | | RedisCacheConfiguration redisCacheConfiguration, |
| | | IailabCacheProperties iailabCacheProperties) { |
| | | IailabCacheProperties iailabCacheProperties, |
| | | TenantProperties tenantProperties) { |
| | | // 创建 RedisCacheWriter 对象 |
| | | RedisConnectionFactory connectionFactory = Objects.requireNonNull(redisTemplate.getConnectionFactory()); |
| | | RedisCacheWriter cacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory, |
| | | BatchStrategies.scan(iailabCacheProperties.getRedisScanBatchSize())); |
| | | // 创建 TenantRedisCacheManager 对象 |
| | | return new TenantRedisCacheManager(cacheWriter, redisCacheConfiguration); |
| | | return new TenantRedisCacheManager(cacheWriter, redisCacheConfiguration, tenantProperties.getIgnoreCaches()); |
| | | } |
| | | } |