make all queries re fetch every 5 mins
All checks were successful
Deploy Website / docker (ubuntu-latest) (push) Successful in 2m12s

This commit is contained in:
Lee 2024-10-21 07:43:18 +01:00
parent 6baeab930d
commit ad826d7a3f
3 changed files with 2 additions and 8 deletions

View File

@ -19,8 +19,6 @@ import ScoreSaberScore from "@ssr/common/score/impl/scoresaber-score";
import ScoreSaberLeaderboard from "@ssr/common/leaderboard/impl/scoresaber-leaderboard";
import PlayerScoresResponse from "@ssr/common/response/player-scores-response";
const REFRESH_INTERVAL = 1000 * 60 * 5;
type Props = {
initialPlayerData: ScoreSaberPlayer;
initialScoreData?: PlayerScoresResponse<ScoreSaberScore, ScoreSaberLeaderboard>;
@ -47,8 +45,6 @@ export default function PlayerData({ initialPlayerData, initialScoreData, initia
}
return await getScoreSaberPlayerFromToken(playerResponse, settings?.playerId);
},
refetchInterval: REFRESH_INTERVAL,
refetchIntervalInBackground: false,
});
if (data && (!isLoading || !isError)) {

View File

@ -20,8 +20,6 @@ import ScoreSaberLeaderboard from "@ssr/common/leaderboard/impl/scoresaber-leade
import { fetchPlayerScores } from "@ssr/common/utils/score-utils";
import PlayerScoresResponse from "@ssr/common/response/player-scores-response";
const REFRESH_INTERVAL = 1000 * 60 * 5;
type Props = {
initialScoreData?: PlayerScoresResponse<ScoreSaberScore, ScoreSaberLeaderboard>;
initialSearch?: string;
@ -73,8 +71,6 @@ export default function PlayerScores({ initialScoreData, initialSearch, player,
pageState.sort,
debouncedSearchTerm
),
refetchInterval: REFRESH_INTERVAL,
refetchIntervalInBackground: false,
enabled: shouldFetch && (debouncedSearchTerm.length >= 3 || debouncedSearchTerm.length === 0),
});

View File

@ -11,6 +11,8 @@ const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 1000 * 30, // 30 seconds
refetchInterval: 1000 * 60 * 5, // 5 minutes
refetchIntervalInBackground: false,
},
},
});