From 0d39a905f68da4d79da060de9cda92ff54301c24 Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 26 Oct 2024 13:27:53 +0100 Subject: [PATCH] never refresh ranked leaderboards --- projects/backend/src/service/leaderboard.service.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/backend/src/service/leaderboard.service.ts b/projects/backend/src/service/leaderboard.service.ts index eaf923a..3431ba3 100644 --- a/projects/backend/src/service/leaderboard.service.ts +++ b/projects/backend/src/service/leaderboard.service.ts @@ -48,8 +48,9 @@ export default class LeaderboardService { if (cachedLeaderboard != null) { leaderboard = cachedLeaderboard as unknown as ScoreSaberLeaderboard; if ( - leaderboard.lastRefreshed == undefined || - now.getTime() - leaderboard.lastRefreshed.getTime() > 1000 * 60 * 60 * 24 + leaderboard.ranked || // Never refresh ranked leaderboards (it will get refreshed every night) + leaderboard.lastRefreshed == undefined || // Refresh if it has never been refreshed + now.getTime() - leaderboard.lastRefreshed.getTime() > 1000 * 60 * 60 * 24 // Refresh every day ) { foundLeaderboard = true; }