mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
Merge branch 'main' into dev
This commit is contained in:
commit
a84943fdaa
3 files changed
+4
-24
No files matched your search
@@ -38,6 +38,10 @@ const nextConfig = {
|
|||||||
|
|
||||||
distDir: 'dist/website',
|
distDir: 'dist/website',
|
||||||
reactStrictMode: false,
|
reactStrictMode: false,
|
||||||
|
|
||||||
|
experimental: {
|
||||||
|
workerThreads: false,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
@@ -16,7 +16,6 @@ export default async function getRatingInfo(region: Region) {
|
|||||||
region,
|
region,
|
||||||
)}.wotblitz.com/en/api/rating-leaderboards/season/`,
|
)}.wotblitz.com/en/api/rating-leaderboards/season/`,
|
||||||
undefined,
|
undefined,
|
||||||
{ cache: 'no-store' },
|
|
||||||
);
|
);
|
||||||
const data = (await response.json()) as RatingInfo;
|
const data = (await response.json()) as RatingInfo;
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user