From 40d4565ca380d28e181d0e073365882da19e7f13 Mon Sep 17 00:00:00 2001 From: "brobert (aider)" Date: Tue, 1 Apr 2025 14:57:54 +0200 Subject: [PATCH] feat: process blog posts sequentially with rate limiting --- scrape-blog.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scrape-blog.ts b/scrape-blog.ts index 2707a2f..0a98dca 100644 --- a/scrape-blog.ts +++ b/scrape-blog.ts @@ -90,10 +90,11 @@ async function fetchBlogPosts(): Promise { } }; - // Process posts with limited concurrency - const results = await Promise.allSettled( - postUrls.slice(0, 10).map(processPost) // Limit to 10 posts for initial testing - ); + // Process posts sequentially with delay + const results = []; + for (const url of postUrls.slice(0, 10)) { // Limit to 10 posts for initial testing + results.push(await processPost(url)); + } const posts: BlogPost[] = results .filter((result): result is PromiseFulfilledResult =>