diff --git a/RSSAPI/Program.cs b/RSSAPI/Program.cs index dab6535..4e08df0 100644 --- a/RSSAPI/Program.cs +++ b/RSSAPI/Program.cs @@ -337,7 +337,6 @@ app.MapGet("/missav123", async () => // --- APIエンドポイントの定義 --- app.MapGet("/momonga/fanzine", async (HttpContext context, IHttpClientFactory httpClientFactory) => { - // 1. 取得対象のURLを10件定義(例として連番パラメーターを生成) var linkList = new List(); var pageMaster = "https://momon-ga.com/fanzine"; for (int pageId = 1; pageId <= 50; pageId++) @@ -356,7 +355,6 @@ app.MapGet("/momonga/fanzine", async (HttpContext context, IHttpClientFactory ht var client = httpClientFactory.CreateClient(); - // 2. 10件のRSSを「非同期」かつ「並列」で取得し、メモリに展開せずストリームのままパース var fetchTasks = linkList.Select(async url => { try @@ -375,7 +373,6 @@ app.MapGet("/momonga/fanzine", async (HttpContext context, IHttpClientFactory ht } }); - // 3. 全10件の通信完了を待機し、結果のリストを1つに平坦化 (SelectMany) var results = await Task.WhenAll(fetchTasks); var allItems = results.SelectMany(items => items).ToList();