fix:延长缓存时间

This commit is contained in:
lulz1 2024-07-09 15:44:01 +08:00
parent 8c81472f71
commit 370117b2ac
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ public class RedisConfiguration {
@Bean @Bean
public RedisCacheManager cacheManager() { public RedisCacheManager cacheManager() {
RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig() RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig()
.entryTtl(Duration.ofHours(6)); // 设置缓存过期时间为1小时 .entryTtl(Duration.ofHours(12)); // 设置缓存过期时间为1小时
return RedisCacheManager.builder(connectionFactory) return RedisCacheManager.builder(connectionFactory)
.cacheDefaults(config) .cacheDefaults(config)
.build(); .build();