From 09458593186cc29912a12e994bbe656d5b2d8d33 Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Sun, 8 Nov 2026 15:31:04 +0000 Subject: [PATCH] fix(ads): turn off Bun's fetch timeout for the hero call (ours is 14 min) Co-Authored-By: Claude Opus 5.5 --- lib/ads/heroBackfill.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ads/heroBackfill.ts b/lib/ads/heroBackfill.ts index 401d269..ccbe2e9 100644 --- a/lib/ads/heroBackfill.ts +++ b/lib/ads/heroBackfill.ts @@ -55,7 +55,11 @@ export async function generateC0mputeImage( headers: { authorization: `Bearer ${target.token}`, "content-type": "application/json" }, body: JSON.stringify({ prompt: prompt.slice(0, 2000), width: 768, height: 512 }), signal: AbortSignal.timeout(GENERATE_TIMEOUT_MS), - }); + // The worker runs on Bun, whose fetch has its own default timeout; ours + // above is the one that should apply (a CPU image can pass 5 minutes). + // Node's fetch ignores this key. + timeout: false, + } as RequestInit); if (!res.ok) { const detail = (await res.text().catch(() => "")).slice(0, 200); throw new C0mputeImageError(`c0mpute image ${res.status}: ${detail}`, res.status);