From 3e0479824dd9e5b7290b074a7d95b639e4b74568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Mon, 17 Jun 2024 12:16:35 -0500 Subject: [PATCH] fix: remove no-store for rating --- src/core/blitz/getRatingInfo.ts | 1 - src/core/blitzkit/patientFetchJSON.ts | 23 ----------------------- 2 files changed, 24 deletions(-) delete mode 100644 src/core/blitzkit/patientFetchJSON.ts diff --git a/src/core/blitz/getRatingInfo.ts b/src/core/blitz/getRatingInfo.ts index c900bb101..d85a7e1d9 100644 --- a/src/core/blitz/getRatingInfo.ts +++ b/src/core/blitz/getRatingInfo.ts @@ -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; diff --git a/src/core/blitzkit/patientFetchJSON.ts b/src/core/blitzkit/patientFetchJSON.ts deleted file mode 100644 index de3a31105..000000000 --- a/src/core/blitzkit/patientFetchJSON.ts +++ /dev/null @@ -1,23 +0,0 @@ -export async function patientFetchJSON( - 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; -}