diff --git a/src/main/kotlin/fr/shikkanime/services/caches/MemberCacheService.kt b/src/main/kotlin/fr/shikkanime/services/caches/MemberCacheService.kt index c7e0c830..8e901d4f 100644 --- a/src/main/kotlin/fr/shikkanime/services/caches/MemberCacheService.kt +++ b/src/main/kotlin/fr/shikkanime/services/caches/MemberCacheService.kt @@ -8,6 +8,7 @@ import fr.shikkanime.entities.MemberFollowAnime import fr.shikkanime.entities.MemberFollowEpisode import fr.shikkanime.services.MemberService import fr.shikkanime.utils.MapCache +import java.time.Duration import java.util.* class MemberCacheService : AbstractCacheService { @@ -19,7 +20,10 @@ class MemberCacheService : AbstractCacheService { } private val findPrivateMemberCache = - MapCache(classes = listOf(Member::class.java, MemberFollowAnime::class.java, MemberFollowEpisode::class.java)) { + MapCache( + duration = Duration.ofHours(1), + classes = listOf(Member::class.java, MemberFollowAnime::class.java, MemberFollowEpisode::class.java), + ) { memberService.findPrivateMember(it) ?.let { member -> AbstractConverter.convert(member, MemberDto::class.java) } }