Skip to content

Commit

Permalink
move to loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyGaluzo committed May 23, 2024
1 parent 46ac216 commit b438454
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -526,10 +526,17 @@ async Task MergeVersioned(List<ImportResource> inputs, bool useReplicasForReads)
var loadCandidates = new List<ImportResource>();
foreach (var resource in inputsWithVersion)
{
if (versionsInDb.TryGetValue(resource.ResourceWrapper.ToResourceKey(), out var versionInDb)
&& !(versionInDb.LastModified == resource.ResourceWrapper.LastModified && versionInDb.RawResource.Data == resource.ResourceWrapper.RawResource.Data))
if (versionsInDb.TryGetValue(resource.ResourceWrapper.ToResourceKey(), out var versionInDb))
{
conflicts.Add(resource); // version match but diff dates or raw resources
var identical = versionInDb.LastModified == resource.ResourceWrapper.LastModified && versionInDb.RawResource.Data == resource.ResourceWrapper.RawResource.Data;
if (identical)
{
loaded.Add(resource);
}
else
{
conflicts.Add(resource); // version match but diff dates or raw resources
}
}
else
{
Expand Down

0 comments on commit b438454

Please sign in to comment.