Skip to the content

Capsid menu

app/lib/timed-fetch.server.ts

5 lines and 1 functions in DrDustinEdwards/carrel, at commit d5d5e82 on 2026-10-24. This file on GitHub.

Functions

The functions of timed-fetch.server.ts
FunctionLinesComplexityCoveredCRAPMutation
timedFetch7 to 72100%OkCRAP 2No data: mutation testing has not run on this repo yet

Imports

It imports no other module of this repo. Imported by app/lib/google/drive.server.ts, app/lib/google/oauth.server.ts, app/lib/google/service-account.server.ts, app/lib/health.server.ts, app/lib/inbox-report.server.ts, app/lib/novels/repo.server.ts, app/lib/sites.server.ts, app/lib/social/platforms.server.ts, app/lib/social/queue.server.ts.

Source

// The default fetch for every outbound call: GitHub, Google, the sites, social and the routine. A hung
// upstream would otherwise hold the request, or the cron tick, until the runtime cut it off (Grok audit
// 2026-10-21, CR-4). A caller's own signal wins.

const OUTBOUND_TIMEOUT_MS = 20_000;

export const timedFetch: typeof fetch = (input, init) => fetch(input, { ...init, signal: init?.signal ?? AbortSignal.timeout(OUTBOUND_TIMEOUT_MS) });