Skip to content

Commit

Permalink
Fixed concurrency issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Oct 11, 2024
1 parent f725df1 commit c845616
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/BUTR.CrashReport.Server/Controllers/ReportController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ public ActionResult<IEnumerable<FileMetadata>> RegenerateHtmlCrashReports(byte t
public IActionResult SitemapIndex()
{
var sitemaps = new List<Sitemap>();
foreach (var tenant in _dbContext.ReportEntities.Select(x => x.Tenant).Distinct())

var tenants = _dbContext.ReportEntities.Select(x => x.Tenant).Distinct().ToList();
foreach (var tenant in tenants)
{
var count = _dbContext.ReportEntities.Count(x => x.Tenant == tenant);
var sitemapsCount = (count / 50000) + 1;
Expand Down

0 comments on commit c845616

Please sign in to comment.