test #341

Merged
klaus merged 6 commits from test into main 2025-09-14 20:33:51 +00:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit 7f3589dcfb - Show all commits

View File

@ -45,10 +45,10 @@ class ChatCharacterService(
@Transactional(readOnly = true) @Transactional(readOnly = true)
@Cacheable( @Cacheable(
cacheNames = ["popularCharacters_24h"], cacheNames = ["popularCharacters_24h"],
key = "T(kr.co.vividnext.sodalive.chat.character.service.RankingWindowCalculator).now('popular-chat-character').cacheKey" key = "T(kr.co.vividnext.sodalive.chat.character.service.RankingWindowCalculator).now('popular-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-character")
val topIds = popularCharacterQuery.findPopularCharacterIds(window.windowStart, window.nextBoundary, limit) val topIds = popularCharacterQuery.findPopularCharacterIds(window.windowStart, window.nextBoundary, limit)
val list = loadCharactersInOrder(topIds) val list = loadCharactersInOrder(topIds)
return list.map { return list.map {

View File

@ -20,7 +20,7 @@ object RankingWindowCalculator {
private const val BOUNDARY_HOUR = 20 // 20:00:00 UTC private const val BOUNDARY_HOUR = 20 // 20:00:00 UTC
@JvmStatic @JvmStatic
fun now(prefix: String = "popular-chat-character"): RankingWindow { fun now(prefix: String = "popular-character"): RankingWindow {
val now = ZonedDateTime.now(ZONE) val now = ZonedDateTime.now(ZONE)
val todayBoundary = now.toLocalDate().atTime(BOUNDARY_HOUR, 0, 0).atZone(ZONE) val todayBoundary = now.toLocalDate().atTime(BOUNDARY_HOUR, 0, 0).atZone(ZONE)