meow
All checks were successful
Deploy Backend / docker (ubuntu-latest) (push) Successful in 45s
Deploy Website / docker (ubuntu-latest) (push) Successful in 2m25s

This commit is contained in:
Lee
2024-10-26 13:16:55 +01:00
parent da7f5f1c62
commit 6bc2e09f43
2 changed files with 7 additions and 16 deletions

View File

@ -40,13 +40,17 @@ export default class LeaderboardService {
let leaderboard: Leaderboard | undefined;
let beatSaverMap: BeatSaverMap | undefined;
const now = new Date();
switch (leaderboardName) {
case "scoresaber": {
let foundLeaderboard = false;
const cachedLeaderboard = await ScoreSaberLeaderboardModel.findById(id);
if (cachedLeaderboard != null) {
leaderboard = cachedLeaderboard as unknown as ScoreSaberLeaderboard;
if (!leaderboard.shouldRefresh()) {
if (
leaderboard.lastRefreshed == undefined ||
now.getTime() - leaderboard.lastRefreshed.getTime() > 1000 * 60 * 60 * 24
) {
foundLeaderboard = true;
}
}