chore: drop comments that restate the code
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user