test #340

Merged
klaus merged 11 commits from test into main 2025-09-14 08:51:12 +00:00
2 changed files with 0 additions and 15 deletions
Showing only changes of commit dd0a1c2293 - Show all commits

View File

@ -19,7 +19,6 @@ import kr.co.vividnext.sodalive.chat.character.repository.ChatCharacterRepositor
import kr.co.vividnext.sodalive.chat.character.repository.ChatCharacterTagRepository import kr.co.vividnext.sodalive.chat.character.repository.ChatCharacterTagRepository
import kr.co.vividnext.sodalive.chat.character.repository.ChatCharacterValueRepository import kr.co.vividnext.sodalive.chat.character.repository.ChatCharacterValueRepository
import org.springframework.beans.factory.annotation.Value import org.springframework.beans.factory.annotation.Value
import org.springframework.cache.annotation.Cacheable
import org.springframework.data.domain.PageRequest import org.springframework.data.domain.PageRequest
import org.springframework.data.domain.Sort import org.springframework.data.domain.Sort
import org.springframework.stereotype.Service import org.springframework.stereotype.Service
@ -43,10 +42,6 @@ class ChatCharacterService(
* Spring Cache(@Cacheable) + 동적 + 고정 TTL(24h) 사용 * Spring Cache(@Cacheable) + 동적 + 고정 TTL(24h) 사용
*/ */
@Transactional(readOnly = true) @Transactional(readOnly = true)
@Cacheable(
cacheNames = ["popularCharacters_24h"],
key = "T(kr.co.vividnext.sodalive.chat.character.service.RankingWindowCalculator).now('popular-chat-character').cacheKey"
)
fun getPopularCharacters(limit: Long = 20): List<Character> { fun getPopularCharacters(limit: Long = 20): List<Character> {
val window = RankingWindowCalculator.now("popular-chat-character") val window = RankingWindowCalculator.now("popular-chat-character")
val topIds = popularCharacterQuery.findPopularCharacterIds(window.windowStart, window.nextBoundary, limit) val topIds = popularCharacterQuery.findPopularCharacterIds(window.windowStart, window.nextBoundary, limit)

View File

@ -123,16 +123,6 @@ class RedisConfig(
) )
) )
// 24시간 TTL 캐시: 인기 캐릭터 집계용
cacheConfigMap["popularCharacters_24h"] = RedisCacheConfiguration.defaultCacheConfig()
.entryTtl(Duration.ofHours(24))
.serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(StringRedisSerializer()))
.serializeValuesWith(
RedisSerializationContext.SerializationPair.fromSerializer(
GenericJackson2JsonRedisSerializer()
)
)
return RedisCacheManager.builder(redisConnectionFactory) return RedisCacheManager.builder(redisConnectionFactory)
.cacheDefaults(defaultCacheConfig) .cacheDefaults(defaultCacheConfig)
.withInitialCacheConfigurations(cacheConfigMap) .withInitialCacheConfigurations(cacheConfigMap)