fix: remove no-store for rating

This commit is contained in:
TrèsAbhi committed 2024-06-17 12:16:35 -05:00
1 parent 48ee173cbc
commit 3e0479824d
2 files changed
-24

No files matched your search

-1
View File
@@ -16,7 +16,6 @@ export default async function getRatingInfo(region: Region) {
region,
)}.wotblitz.com/en/api/rating-leaderboards/season/`,
undefined,
{ cache: 'no-store' },
);
const data = (await response.json()) as RatingInfo;
-23
View File
@@ -1,23 +0,0 @@
export async function patientFetchJSON<Type extends object>(
url: string,
timeout = 1000,
options?: Partial<{ cache: 'no-store' }>,
) {
let patientJSON: Type;
while (patientJSON! === undefined) {
try {
patientJSON = (await fetch(url, options).then((response) =>
response.json(),
)) as Type;
} catch (error) {
console.warn(
`Failed to fetch ${url} as JSON; retrying in ${timeout}ms...`,
error,
);
await new Promise((resolve) => setTimeout(resolve, timeout));
}
}
return patientJSON;
}