diff --git a/CHANGELOG.MD b/CHANGELOG.MD index ae4a2894..bc951ff2 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -2,6 +2,12 @@ 更新日志文档,版本顺序从新到旧,最新版本在最前(上)面。 +# 0.19.2 + +## 优化 + +- 优化剧集保存时的缓存配置 + # 0.19.1 ## 问题修复 diff --git a/gradle.properties b/gradle.properties index 8fa71c16..a81144af 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=0.19.0 +version=0.19.2 diff --git a/server/src/main/java/run/ikaros/server/core/episode/DefaultEpisodeService.java b/server/src/main/java/run/ikaros/server/core/episode/DefaultEpisodeService.java index 627b7f41..03420d7d 100644 --- a/server/src/main/java/run/ikaros/server/core/episode/DefaultEpisodeService.java +++ b/server/src/main/java/run/ikaros/server/core/episode/DefaultEpisodeService.java @@ -5,7 +5,6 @@ import java.util.List; import lombok.extern.slf4j.Slf4j; import org.springframework.cache.annotation.CacheEvict; -import org.springframework.cache.annotation.CachePut; import org.springframework.cache.annotation.Cacheable; import org.springframework.context.ApplicationEventPublisher; import org.springframework.r2dbc.core.DatabaseClient; @@ -48,7 +47,12 @@ public DefaultEpisodeService(EpisodeRepository episodeRepository, @Override - @CachePut(value = "episodeWithName", key = "#episode.name") + @CacheEvict(value = {"episodeWithId", "episodesWithSubjectId", + "episodeWithSubjectIdAndGroupAndSeqAndName", + "episodesWithSubjectIdAndGroupAndSeq", + "episodeCountWithSubjectId", "episodeMatchingCountWithSubjectId", + "episodesWithId", "episodeWithName" + }, allEntries = true) public Mono save(Episode episode) { Assert.notNull(episode, "episode must not be null"); Long episodeId = episode.getId(); @@ -166,8 +170,7 @@ public Flux findResourcesById(Long episodeId) { "episodesWithSubjectIdAndGroupAndSeq", "episodeCountWithSubjectId", "episodeMatchingCountWithSubjectId", "episodesWithId", "episodeWithName" - }, - allEntries = true) + }, allEntries = true) public Flux updateEpisodesWithSubjectId(Long subjectId, List episodes) { Assert.isTrue(subjectId >= 0, "'subjectId' must >= 0."); Assert.notNull(episodes, "'episodes' must not be null.");