feat(auditlog): hot-reloadable AuditLogOptions + regex cache invalidation (#23 M5)

This commit is contained in:
Joseph Doherty
2026-05-20 17:35:15 -04:00
parent 23c0fd417e
commit b409afda2e
2 changed files with 227 additions and 1 deletions

View File

@@ -22,7 +22,13 @@ namespace ScadaLink.AuditLog.Payload;
/// <para>
/// Uses <see cref="IOptionsMonitor{TOptions}"/> (not <see cref="IOptions{TOptions}"/>)
/// so the M5-T8 hot-reload path sees fresh values without re-resolving the
/// singleton.
/// singleton. <see cref="Apply"/> reads <see cref="IOptionsMonitor{T}.CurrentValue"/>
/// on every call, and the regex cache is keyed by pattern string — patterns
/// added via a live config change compile on first use of the next event;
/// patterns removed simply stop being looked up. No <c>OnChange</c> subscription
/// or explicit cache invalidation is required (the
/// <c>AuditLogOptionsBindingTests</c> fixture in <c>ScadaLink.AuditLog.Tests</c>
/// pins this behaviour).
/// </para>
/// <para>
/// "Error row" = <see cref="AuditEvent.Status"/> NOT IN (<c>Delivered</c>,