Line data Source code
1 : /**
2 : * The request bounds `api.fetchApi` enforces, in their own leaf module so that
3 : * a caller which must OUTLAST a request can derive its bound from the same
4 : * numbers instead of restating them.
5 : *
6 : * Deliberately not exported from `api.ts`: `src/scripts/__mocks__/api.ts` is
7 : * the manual mock every `vi.mock('@/scripts/api')` resolves to, and it exports
8 : * only `api` — so a constant read through that path arrives `undefined` and any
9 : * arithmetic on it silently becomes `NaN`. A `setTimeout` armed with `NaN`
10 : * fires immediately, which is exactly the failure a derived timeout must not
11 : * have. Importing from here keeps the real values under a mocked `api`.
12 : */
13 :
14 : /** Ceiling on `ComfyApi.waitForAuthInitialization`, spent before the response timer below is armed. */
15 2356 : export const AUTH_INIT_TIMEOUT_MS = 10_000
16 :
17 : /**
18 : * Response-HEADERS timeout for one `fetchApi` attempt — not the body. A 401
19 : * remint clears this timer and arms a fresh one for the retry, so a single
20 : * cloud request can spend it twice (`fetchWithUnifiedRemint`).
21 : */
22 2356 : export const FETCH_RESPONSE_HEADERS_TIMEOUT_MS = 60_000
|