|
|
|
@ -20,7 +20,7 @@ public class RedisCacheConfig { |
|
|
|
public RedisCacheManager cacheManager(RedisConnectionFactory redisConnectionFactory) { |
|
|
|
public RedisCacheManager cacheManager(RedisConnectionFactory redisConnectionFactory) { |
|
|
|
// 配置统一的缓存过期时间
|
|
|
|
// 配置统一的缓存过期时间
|
|
|
|
RedisCacheConfiguration cacheConfiguration = RedisCacheConfiguration.defaultCacheConfig() |
|
|
|
RedisCacheConfiguration cacheConfiguration = RedisCacheConfiguration.defaultCacheConfig() |
|
|
|
.entryTtl(Duration.ofHours(4)); //
|
|
|
|
.entryTtl(Duration.ofHours(24)); //
|
|
|
|
|
|
|
|
|
|
|
|
// 创建一个缓存管理器,使用默认配置,并为所有缓存设置统一的过期时间
|
|
|
|
// 创建一个缓存管理器,使用默认配置,并为所有缓存设置统一的过期时间
|
|
|
|
RedisCacheManager res = RedisCacheManager.builder(redisConnectionFactory) |
|
|
|
RedisCacheManager res = RedisCacheManager.builder(redisConnectionFactory) |
|
|
|
|