From d5c89fa6cacf686815d9947bcabdf1386bd1c297 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Fri, 21 May 2021 22:53:56 -0500 Subject: [PATCH] Added Task.Yield call to category top tagging portion. --- src/MultiShop/Client/Pages/Search.razor.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/MultiShop/Client/Pages/Search.razor.cs b/src/MultiShop/Client/Pages/Search.razor.cs index 4273ef5..17512df 100644 --- a/src/MultiShop/Client/Pages/Search.razor.cs +++ b/src/MultiShop/Client/Pages/Search.razor.cs @@ -131,11 +131,14 @@ namespace MultiShop.Client.Pages searching = false; searched = true; + int tagsAdded = 0; foreach (ResultsProfile.Category c in greatest.Keys) { foreach (ProductListingInfo info in greatest[c]) { info.Tops.Add(c); + tagsAdded += 1; + if (tagsAdded % 50 == 0) await Task.Yield(); } } @@ -147,7 +150,7 @@ namespace MultiShop.Client.Pages if (searching) return; organizing = true; StateHasChanged(); - + List sortedResults = await Task.Run>(() => { List sorted = new List(listings);