diff --git a/lib/LeaderboardService.js b/lib/LeaderboardService.js index 89e24c43..59e69535 100644 --- a/lib/LeaderboardService.js +++ b/lib/LeaderboardService.js @@ -1,3 +1,5 @@ +const leaderboardTTL = 60 * 60 * 4 // 4 hours ttl as a relaxation for https://github.com/FAForever/website/issues/482 + class LeaderboardService { constructor(cacheService, mutexService, leaderboardRepository, lockTimeout = 3000) { this.lockTimeout = lockTimeout @@ -26,7 +28,7 @@ class LeaderboardService { await this.mutexService.acquire(async () => { const result = await this.leaderboardRepository.fetchLeaderboard(id) - this.cacheService.set(cacheKey, result); + this.cacheService.set(cacheKey, result, leaderboardTTL); }) return this.getLeaderboard(id)