Monorepo for Wisp.place. A static site hosting service built on top of the AT Protocol.

update timeout on safe-fetch for hosting-service

Changed files
+3 -2
hosting-service
+1
hosting-service/src/lib/safe-fetch.ts
··· 22 22 ]; 23 23 24 24 const FETCH_TIMEOUT = 5000; // 5 seconds 25 + const FETCH_TIMEOUT_BLOB = 120000; // 2 minutes for blob downloads 25 26 const MAX_RESPONSE_SIZE = 10 * 1024 * 1024; // 10MB 26 27 27 28 function isBlockedHost(hostname: string): boolean {
+2 -2
hosting-service/src/lib/utils.ts
··· 265 265 266 266 const blobUrl = `${pdsEndpoint}/xrpc/com.atproto.sync.getBlob?did=${encodeURIComponent(did)}&cid=${encodeURIComponent(cid)}`; 267 267 268 - // Allow up to 100MB per file blob 269 - let content = await safeFetchBlob(blobUrl, { maxSize: 100 * 1024 * 1024 }); 268 + // Allow up to 100MB per file blob, with 2 minute timeout 269 + let content = await safeFetchBlob(blobUrl, { maxSize: 100 * 1024 * 1024, timeout: 120000 }); 270 270 271 271 // If content is base64-encoded, decode it back to gzipped binary 272 272 if (base64 && encoding === 'gzip') {