|
|
|
@ -69,7 +69,8 @@ class RedisCacheConfiguration { |
|
|
|
public RedisCacheManager cacheManager(RedisConnectionFactory redisConnectionFactory, |
|
|
|
public RedisCacheManager cacheManager(RedisConnectionFactory redisConnectionFactory, |
|
|
|
ResourceLoader resourceLoader) { |
|
|
|
ResourceLoader resourceLoader) { |
|
|
|
RedisCacheManagerBuilder builder = RedisCacheManager |
|
|
|
RedisCacheManagerBuilder builder = RedisCacheManager |
|
|
|
.builder(redisConnectionFactory).cacheDefaults(determineConfiguration(resourceLoader.getClassLoader())); |
|
|
|
.builder(redisConnectionFactory) |
|
|
|
|
|
|
|
.cacheDefaults(determineConfiguration(resourceLoader.getClassLoader())); |
|
|
|
List<String> cacheNames = this.cacheProperties.getCacheNames(); |
|
|
|
List<String> cacheNames = this.cacheProperties.getCacheNames(); |
|
|
|
if (!cacheNames.isEmpty()) { |
|
|
|
if (!cacheNames.isEmpty()) { |
|
|
|
builder.initialCacheNames(new LinkedHashSet<>(cacheNames)); |
|
|
|
builder.initialCacheNames(new LinkedHashSet<>(cacheNames)); |
|
|
|
@ -85,8 +86,8 @@ class RedisCacheConfiguration { |
|
|
|
Redis redisProperties = this.cacheProperties.getRedis(); |
|
|
|
Redis redisProperties = this.cacheProperties.getRedis(); |
|
|
|
org.springframework.data.redis.cache.RedisCacheConfiguration config = org.springframework.data.redis.cache.RedisCacheConfiguration |
|
|
|
org.springframework.data.redis.cache.RedisCacheConfiguration config = org.springframework.data.redis.cache.RedisCacheConfiguration |
|
|
|
.defaultCacheConfig(); |
|
|
|
.defaultCacheConfig(); |
|
|
|
config = config.serializeValuesWith(SerializationPair.fromSerializer( |
|
|
|
config = config.serializeValuesWith(SerializationPair |
|
|
|
new JdkSerializationRedisSerializer(classLoader))); |
|
|
|
.fromSerializer(new JdkSerializationRedisSerializer(classLoader))); |
|
|
|
if (redisProperties.getTimeToLive() != null) { |
|
|
|
if (redisProperties.getTimeToLive() != null) { |
|
|
|
config = config.entryTtl(redisProperties.getTimeToLive()); |
|
|
|
config = config.entryTtl(redisProperties.getTimeToLive()); |
|
|
|
} |
|
|
|
} |
|
|
|
|