fix: minor counting fit for creating index pages

This commit is contained in:
D. Moonfire 2024-03-09 16:00:19 -06:00
parent a6ad0b18d1
commit 6b1d1640ef

View file

@ -73,6 +73,7 @@ public partial class CreateOrUpdateIndex : OperationBase
// find, we update with the existing entries. If we get to the end and
// still have any left over, we create those pages.
HashSet<string> existing = new();
int created = 0;
foreach (Entity? entity in input)
{
@ -102,6 +103,7 @@ public partial class CreateOrUpdateIndex : OperationBase
{
foreach (string key in scanned.Keys.Where(key => !existing.Contains(key)))
{
created++;
yield return this.CreateIndex(key, scanned[key]);
}
}
@ -110,7 +112,7 @@ public partial class CreateOrUpdateIndex : OperationBase
this.logger.LogDebug(
"Found {Old:N0} and created {New:N0} index pages for {Keys:N0} keys",
existing.Count,
scanned.Count - existing.Count,
created,
scanned.Keys.Count()
);
}