chore: drop comments that restate the code

This commit is contained in:
edmand46
2026-09-29 16:43:15 +03:00
parent 17a55888a5
commit 4a167df587
25 changed files with 16 additions and 350 deletions
+2 -6
View File
@@ -1,7 +1,3 @@
// Minimal fetch wrapper for the LiveOps platform/admin HTTP API used by the seed
// and by tests' admin-side assertions. Retries network errors and 5xx with backoff;
// fails fast on 4xx.
const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));
export class ApiError extends Error {
@@ -54,8 +50,8 @@ export function createAdminClient(baseUrl: string): AdminClient {
if (!res.ok) throw new ApiError(res.status, path, text);
return (text ? JSON.parse(text) : undefined) as T;
} catch (err) {
if (err instanceof ApiError) throw err; // 4xx — don't retry
lastErr = err; // network error — retry
if (err instanceof ApiError) throw err;
lastErr = err;
await sleep(300 * (attempt + 1));
}
}