a tool for shared writing and social publishing

upload blobs sequentially instead of in parallel

+10 -12
+10 -12
actions/publishToPublication.ts
··· 84 84 .filter((b) => b.type == "link") 85 85 .map((b) => scan.eav(b.value, "link/preview")[0]); 86 86 let imageMap = new Map<string, BlobRef>(); 87 - await Promise.all( 88 - [...links, ...images].map(async (b) => { 89 - if (!b) return; 90 - let data = await fetch(b.data.src); 91 - if (data.status !== 200) return; 92 - let binary = await data.blob(); 93 - let blob = await agent.com.atproto.repo.uploadBlob(binary, { 94 - headers: { "Content-Type": binary.type }, 95 - }); 96 - imageMap.set(b.data.src, blob.data.blob); 97 - }), 98 - ); 87 + for (const b of [...links, ...images]) { 88 + if (!b) continue; 89 + let data = await fetch(b.data.src); 90 + if (data.status !== 200) continue; 91 + let binary = await data.blob(); 92 + let blob = await agent.com.atproto.repo.uploadBlob(binary, { 93 + headers: { "Content-Type": binary.type }, 94 + }); 95 + imageMap.set(b.data.src, blob.data.blob); 96 + } 99 97 100 98 let b: PubLeafletPagesLinearDocument.Block[] = blocksToRecord( 101 99 blocks,