From 604888d3b6b44bf2db1b0388c39b4004297fdb35 Mon Sep 17 00:00:00 2001 From: Seth Etter Date: Mon, 15 Jun 2026 09:16:30 -0500 Subject: [PATCH] Put a 30s timeout on fetches --- src/http.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/http.ts b/src/http.ts index 2277148..2ff429f 100644 --- a/src/http.ts +++ b/src/http.ts @@ -15,7 +15,10 @@ export async function fetchJson( url: string | URL, init?: RequestInit, ): Promise { - const resp = await fetch(url, init); + const resp = await fetch(url, { + ...init, + signal: init?.signal ?? AbortSignal.timeout(30_000), + }); if (!resp.ok) throw new HttpError(what, resp.status, await resp.text()); return resp.json() as Promise; } -- 2.51.2