mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-21 14:30:59 +08:00
fix: 文章缓存修改为 10 min
This commit is contained in:
@@ -97,8 +97,10 @@ public class CachingConfig {
|
||||
// 个别缓存单独设置 TTL 时间
|
||||
Map<String, RedisCacheConfiguration> cacheConfigs = new HashMap<>();
|
||||
RedisCacheConfiguration oneHourConfig = config.entryTtl(Duration.ofHours(1));
|
||||
RedisCacheConfiguration tenMinutesConfig = config.entryTtl(Duration.ofMinutes(10));
|
||||
cacheConfigs.put(TAG_CACHE_NAME, oneHourConfig);
|
||||
cacheConfigs.put(CATEGORY_CACHE_NAME, oneHourConfig);
|
||||
cacheConfigs.put(POST_CACHE_NAME, tenMinutesConfig);
|
||||
|
||||
return RedisCacheManager.builder(connectionFactory)
|
||||
.cacheDefaults(config)
|
||||
|
||||
@@ -190,7 +190,7 @@ public class PostService {
|
||||
return saved;
|
||||
}
|
||||
@CacheEvict(
|
||||
value = CachingConfig.POST_CACHE_NAME, allEntries = true
|
||||
value = CachingConfig.POST_CACHE_NAME, allEntries = true
|
||||
)
|
||||
public Post createPost(String username,
|
||||
Long categoryId,
|
||||
|
||||
Reference in New Issue
Block a user