[object Object]

← back to Designer Wallcoverings

Harden Tres Tintas spec recrawl: per-request fetch timeout (45s) so a half-open vendor socket can't wedge the batch

6638fe05261c474e2371ccabd35aad1dffc02070 · 2026-06-23 11:36:41 -0700 · Steve Abrams

Files touched

Diff

commit 6638fe05261c474e2371ccabd35aad1dffc02070
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue Jun 23 11:36:41 2026 -0700

    Harden Tres Tintas spec recrawl: per-request fetch timeout (45s) so a half-open vendor socket can't wedge the batch
---
 shopify/scripts/tres-tintas-spec-recrawl.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/shopify/scripts/tres-tintas-spec-recrawl.js b/shopify/scripts/tres-tintas-spec-recrawl.js
index 343d9ea0..bf06c79c 100644
--- a/shopify/scripts/tres-tintas-spec-recrawl.js
+++ b/shopify/scripts/tres-tintas-spec-recrawl.js
@@ -63,11 +63,11 @@ async function gql(query, variables) {
 }
 
 // --- vendor lookups (with retry — vendor drops sockets intermittently) ----
-async function fetchRetry(url, opts, tries = 3) {
+async function fetchRetry(url, opts, tries = 3, timeoutMs = 45000) {
   let lastErr;
   for (let i = 0; i < tries; i++) {
-    try { return await fetch(url, opts); }
-    catch (e) { lastErr = e; await sleep(800 * (i + 1)); }   // backoff
+    try { return await fetch(url, { ...opts, signal: AbortSignal.timeout(timeoutMs) }); }
+    catch (e) { lastErr = e; await sleep(800 * (i + 1)); }   // backoff (incl. AbortError on socket hang)
   }
   throw lastErr;
 }

← c222b30c Harden Tres Tintas room generator: per-request fetch timeout  ·  back to Designer Wallcoverings  ·  Route room generator GraphQL scan through timeout-guarded fe 90af3941 →