Skip to content

Commit e62c0b8

Browse files
Wouter De RijckCumpsD
authored andcommitted
fix: don't persist processed keys
1 parent 7ac6a5d commit e62c0b8

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

test/BuildingRegistry.Importer.TestClient/BuildingRegistry.Importer.TestClient.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<Reference Include="System.Xml" />
4545
</ItemGroup>
4646
<ItemGroup>
47+
<Compile Include="NonPersistentProcessedKeysSet.cs" />
4748
<Compile Include="SettingsBasedConfig.cs" />
4849
<Compile Include="SqlServerTypes\Loader.cs">
4950
<Paket>True</Paket>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace BuildingRegistry.Importer.TestClient
2+
{
3+
using System.Collections.Generic;
4+
using Be.Vlaanderen.Basisregisters.GrAr.Import.Processing;
5+
6+
public class NonPersistentProcessedKeysSet<T> : IProcessedKeysSet<T>
7+
{
8+
private readonly List<T> _processedKeys = new List<T>();
9+
10+
public bool Contains(T key) => _processedKeys.Contains(key);
11+
12+
public void Add(IEnumerable<T> keys) => _processedKeys.AddRange(keys);
13+
14+
public void Clear() => _processedKeys.Clear();
15+
}
16+
}

test/BuildingRegistry.Importer.TestClient/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ static void Main(string[] args)
6262
fromDate,
6363
terrainObjectId,
6464
!string.IsNullOrEmpty(fromAsString) || modeAsString.Equals("update", StringComparison.OrdinalIgnoreCase) ? ImportMode.Update : ImportMode.Init))
65+
.UseProcessedKeysSet(new NonPersistentProcessedKeysSet<int>())
6566
.UseCommandProcessorConfig(settings)
6667
.UseDefaultSerializerSettingsForCrabImports()
6768
.UseLoggerFactory(new LoggerFactory())

0 commit comments

Comments
 (0)