feat(auditlog): make SiteAuditBacklogReporter cadence configurable (deferred #21)

Consolidates the reporter's poll cadence onto SqliteAuditWriterOptions instead of
the hard-coded 30 s constant, closing deferred-work register item #21 (the config-
shape cleanup its own XML doc flagged as a follow-up).

- SqliteAuditWriterOptions.BacklogPollIntervalSeconds (default 30).
- Reporter reads it via IOptions; precedence explicit-override (tests) > configured
  > 30 s default; a non-positive value falls back to the default. Corrected the
  stale "hard-code / tunable in a follow-up" class-doc.
- Cadence tests + register updated (row 21 -> Resolved).

Claude-Session: https://claude.ai/code/session_01MtdgwpEeCUn6cUA5f1LMPj
This commit is contained in:
Joseph Doherty
2026-07-10 08:56:32 -04:00
parent f480a56737
commit 4cd21b342b
4 changed files with 104 additions and 7 deletions
@@ -24,4 +24,13 @@ public sealed class SqliteAuditWriterOptions
/// <summary>Soft flush interval the writer enforces when fewer than BatchSize events are queued.</summary>
public int FlushIntervalMs { get; set; } = 50;
/// <summary>
/// Poll cadence, in seconds, for the <c>SiteAuditBacklogReporter</c> hosted service
/// that probes the SQLite audit backlog and pushes the snapshot onto the site health
/// report. Half a typical 60 s health-report interval keeps the snapshot fresh without
/// spinning the SQL probe more often than necessary. A non-positive value falls back to
/// the reporter's 30 s default.
/// </summary>
public int BacklogPollIntervalSeconds { get; set; } = 30;
}