feat(ranking): 스냅샷 스케줄러를 job 서비스에 연결한다

This commit is contained in:
2026-06-09 11:22:09 +09:00
parent aad1f02648
commit 767808ab88
3 changed files with 75 additions and 68 deletions

View File

@@ -1,6 +1,6 @@
package kr.co.vividnext.sodalive.v2.ranking.adapter.out.scheduler
import kr.co.vividnext.sodalive.v2.ranking.application.CreatorRankingSnapshotRefreshService
import kr.co.vividnext.sodalive.v2.ranking.application.CreatorRankingSnapshotJobService
import org.redisson.api.RedissonClient
import org.springframework.scheduling.annotation.Scheduled
import org.springframework.stereotype.Component
@@ -8,7 +8,7 @@ import java.util.concurrent.TimeUnit
@Component
class CreatorRankingSnapshotScheduler(
private val refreshService: CreatorRankingSnapshotRefreshService,
private val jobService: CreatorRankingSnapshotJobService,
private val redissonClient: RedissonClient
) {
@Scheduled(cron = "0 30 7 * * MON", zone = "Asia/Seoul")
@@ -18,7 +18,7 @@ class CreatorRankingSnapshotScheduler(
try {
if (lock.tryLock(0, -1, TimeUnit.SECONDS)) {
refreshService.refreshLastCompletedWeek()
jobService.refreshLastCompletedWeekByScheduledJob()
}
} finally {
if (lock.isHeldByCurrentThread) {