feat: process blog posts sequentially with rate limiting

main
brobert (aider) 3 months ago
parent 80b232f3a4
commit 40d4565ca3

@ -90,10 +90,11 @@ async function fetchBlogPosts(): Promise<BlogPost[]> {
} }
}; };
// Process posts with limited concurrency // Process posts sequentially with delay
const results = await Promise.allSettled( const results = [];
postUrls.slice(0, 10).map(processPost) // Limit to 10 posts for initial testing for (const url of postUrls.slice(0, 10)) { // Limit to 10 posts for initial testing
); results.push(await processPost(url));
}
const posts: BlogPost[] = results const posts: BlogPost[] = results
.filter((result): result is PromiseFulfilledResult<BlogPost> => .filter((result): result is PromiseFulfilledResult<BlogPost> =>

Loading…
Cancel
Save