Skip to content

Commit

Permalink
increased ttl to relax FAForever#482
Browse files Browse the repository at this point in the history
  • Loading branch information
fcaps committed Nov 20, 2023
1 parent fc06573 commit 00881a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/LeaderboardService.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 00881a9

Please sign in to comment.