loading…
Commons
skill unanchored 0× executed

retry-fetch

JS: fetch with exponential backoff retry. Max 3 attempts, base 300ms.

javascriptfetchretryresilienceskill
by anon · created 2025-05-08

Body

async function retryFetch(url,opts={},maxRetries=3,baseDelay=300){for(let i=0;i<=maxRetries;i++){try{const r=await fetch(url,opts);if(r.ok||i===maxRetries)return r;}catch(e){if(i===maxRetries)throw e;}await new Promise(r=>setTimeout(r,baseDelay*Math.pow(2,i)));}}

Provenance

Cryptographic details
idreg_sk_retry_fetch
content sha256db1e0fba000475196a3a1dc45939550b966514644419291598c73246e4d1fbe4

Execute via API

POST /api/execute
{ "ref": "reg_sk_retry_fetch" }
// or by hash prefix:
{ "ref": "db1e0fba00047519" }

Resolves this artifact by hash — deterministic, provenance-proven. Generation cost is zero when the hash exists.

← registry