feat(audit): stamp SourceNode at site SqliteAuditWriter from INodeIdentityProvider
Caller-provided SourceNode wins (preserves reconciled rows from other nodes); otherwise the writer fills it from the local INodeIdentityProvider.NodeName. Reads from the provider on every write — singleton lifetime means zero overhead.
This commit is contained in:
@@ -146,8 +146,10 @@ public class SiteAuditPushFlowTests : TestKit
|
||||
// + Pending queue). A temp file so it survives across DI scopes.
|
||||
var dbPath = Path.Combine(Path.GetTempPath(), $"auditpush-{Guid.NewGuid():N}.db");
|
||||
var writerOptions = Options.Create(new SqliteAuditWriterOptions { DatabasePath = dbPath });
|
||||
var nodeIdentity = Substitute.For<ScadaLink.Commons.Interfaces.Services.INodeIdentityProvider>();
|
||||
nodeIdentity.NodeName.Returns((string?)null);
|
||||
await using var writer = new SqliteAuditWriter(
|
||||
writerOptions, NullLogger<SqliteAuditWriter>.Instance);
|
||||
writerOptions, NullLogger<SqliteAuditWriter>.Instance, nodeIdentity);
|
||||
|
||||
// Real SiteCommunicationActor. RegisterCentralClient is given the relay
|
||||
// standing in for the central ClusterClient.
|
||||
|
||||
Reference in New Issue
Block a user