Skip to content

Commit

Permalink
Performance improvement for repository merge step
Browse files Browse the repository at this point in the history
  • Loading branch information
Almost-Done committed Jul 12, 2019
1 parent 8607334 commit 634eecb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/library/Storage/UpdatesCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ public void MergeQueryResult(QueryResult queryResult, CategoriesCache categories
var parentRepositoryInternal = ParentRepository as IRepositoryInternal;

List<Update> newBundlingUpdates = new List<Update>();
List<Update> addedUpdates = new List<Update>();

foreach (var newUpdate in queryResult.Updates)
{
Expand All @@ -212,6 +213,7 @@ public void MergeQueryResult(QueryResult queryResult, CategoriesCache categories
newUpdate.LastChanged = DateTime.Now;

Index.Add(newUpdate.Identity, newUpdate);
addedUpdates.Add(newUpdate);

using (var newMetadataStream = File.OpenRead(queryResult.GetUpdateXmlPath(newUpdate)))
{
Expand Down Expand Up @@ -268,7 +270,8 @@ public void MergeQueryResult(QueryResult queryResult, CategoriesCache categories
var productsList = categories.Products.Values.ToList();
var classificationsList = categories.Classifications.Values.ToList();

foreach (var update in Index.Values)
// Fill in product and classification information.
foreach (var update in addedUpdates)
{
var updateWithProduct = update as IUpdateWithProductInternal;
if (updateWithProduct != null)
Expand Down

0 comments on commit 634eecb

Please sign in to comment.