cleanup caching
All checks were successful
Deploy Backend / deploy (push) Successful in 4m0s
Deploy Website / deploy (push) Successful in 7m9s

This commit is contained in:
Lee
2024-10-19 04:10:44 +01:00
parent 238ec6e254
commit 7421c47959
9 changed files with 153 additions and 121 deletions

View File

@ -38,7 +38,6 @@
"next": "15.0.0-rc.1",
"next-build-id": "^3.0.0",
"next-themes": "^0.3.0",
"node-cache": "^5.1.2",
"react": "18.3.1",
"react-chartjs-2": "^5.2.0",
"react-countup": "^6.5.3",

View File

@ -3,7 +3,6 @@ import { redirect } from "next/navigation";
import { Colors } from "@/common/colors";
import { getAverageColor } from "@/common/image-utils";
import { LeaderboardData } from "@/components/leaderboard/leaderboard-data";
import NodeCache from "node-cache";
import { Config } from "@ssr/common/config";
import ScoreSaberScore from "@ssr/common/score/impl/scoresaber-score";
import { LeaderboardResponse } from "@ssr/common/response/leaderboard-response";
@ -11,6 +10,7 @@ import ScoreSaberLeaderboard from "@ssr/common/leaderboard/impl/scoresaber-leade
import { fetchLeaderboard } from "@ssr/common/utils/leaderboard.util";
import { fetchLeaderboardScores } from "@ssr/common/utils/score-utils";
import LeaderboardScoresResponse from "@ssr/common/response/leaderboard-scores-response";
import { SSRCache } from "@ssr/common/cache";
const UNKNOWN_LEADERBOARD = {
title: "ScoreSaber Reloaded - Unknown Leaderboard",
@ -32,7 +32,9 @@ type LeaderboardData = {
page: number;
};
const leaderboardCache = new NodeCache({ stdTTL: 60, checkperiod: 120 });
const leaderboardCache = new SSRCache({
ttl: 1000 * 60, // 1 minute
});
/**
* Gets the leaderboard data and scores

View File

@ -4,7 +4,6 @@ import { redirect } from "next/navigation";
import { Colors } from "@/common/colors";
import { getAverageColor } from "@/common/image-utils";
import { scoresaberService } from "@ssr/common/service/impl/scoresaber";
import NodeCache from "node-cache";
import { getCookieValue } from "@ssr/common/utils/cookie-utils";
import { Config } from "@ssr/common/config";
import ScoreSaberPlayer, { getScoreSaberPlayerFromToken } from "@ssr/common/player/impl/scoresaber-player";
@ -13,6 +12,7 @@ import ScoreSaberScore from "@ssr/common/score/impl/scoresaber-score";
import ScoreSaberLeaderboard from "@ssr/common/leaderboard/impl/scoresaber-leaderboard";
import { fetchPlayerScores } from "@ssr/common/utils/score-utils";
import PlayerScoresResponse from "@ssr/common/response/player-scores-response";
import { SSRCache } from "@ssr/common/cache";
const UNKNOWN_PLAYER = {
title: "ScoreSaber Reloaded - Unknown Player",
@ -36,7 +36,9 @@ type PlayerData = {
search: string;
};
const playerCache = new NodeCache({ stdTTL: 60, checkperiod: 120 });
const playerCache = new SSRCache({
ttl: 1000 * 60, // 1 minute
});
/**
* Gets the player data and scores