Function
fetchJsonWithTimeout
(input: RequestInfo | URL, init: RequestInit, timeoutMs = REQUEST_TIMEOUT_MS)
Source from the content-addressed store, hash-verified
| 56 | } |
| 57 | |
| 58 | async function fetchJsonWithTimeout(input: RequestInfo | URL, init: RequestInit, timeoutMs = REQUEST_TIMEOUT_MS) { |
| 59 | const signal = AbortSignal.timeout(timeoutMs); |
| 60 | return fetch(input, { ...init, signal }); |
| 61 | } |
| 62 | |
| 63 | function sleep(ms: number) { |
| 64 | return new Promise((resolve) => setTimeout(resolve, ms)); |
Tested by
no test coverage detected