调整 移出ip模块
This commit is contained in:
@@ -3,6 +3,7 @@ package com.tashow.cloud.redis.config;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.tashow.cloud.redis.core.TimeoutRedisCacheManager;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.cache.CacheProperties;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -25,7 +26,7 @@ import static com.tashow.cloud.redis.config.RedisAutoConfiguration.buildRedisSer
|
||||
* Cache 配置类,基于 Redis 实现
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@EnableConfigurationProperties({org.springframework.boot.autoconfigure.cache.CacheProperties.class, CacheProperties.class})
|
||||
@EnableConfigurationProperties({CacheProperties.class, TashowCacheProperties.class})
|
||||
@EnableCaching
|
||||
public class CacheAutoConfiguration {
|
||||
|
||||
@@ -70,11 +71,11 @@ public class CacheAutoConfiguration {
|
||||
@Bean
|
||||
public RedisCacheManager redisCacheManager(RedisTemplate<String, Object> redisTemplate,
|
||||
RedisCacheConfiguration redisCacheConfiguration,
|
||||
CacheProperties cacheProperties) {
|
||||
TashowCacheProperties tashowCacheProperties) {
|
||||
// 创建 RedisCacheWriter 对象
|
||||
RedisConnectionFactory connectionFactory = Objects.requireNonNull(redisTemplate.getConnectionFactory());
|
||||
RedisCacheWriter cacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory,
|
||||
BatchStrategies.scan(cacheProperties.getRedisScanBatchSize()));
|
||||
BatchStrategies.scan(tashowCacheProperties.getRedisScanBatchSize()));
|
||||
// 创建 TenantRedisCacheManager 对象
|
||||
return new TimeoutRedisCacheManager(cacheWriter, redisCacheConfiguration);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
@ConfigurationProperties("tashow.cache")
|
||||
@Data
|
||||
@Validated
|
||||
public class CacheProperties {
|
||||
public class TashowCacheProperties {
|
||||
|
||||
/**
|
||||
* {@link #redisScanBatchSize} 默认值
|
||||
Reference in New Issue
Block a user