fix(site-event-log): queries on own read connection off the actor thread, bounded keyword window; cap trim counts/vacuums rarely (review 2026-10-21 02/P1, 02/P4)

This commit is contained in:
Joseph Doherty
2026-10-22 08:30:35 -04:00
parent f7c4adbaed
commit 3169429c3f
9 changed files with 194 additions and 35 deletions
@@ -20,10 +20,14 @@ public class EventLogHandlerActor : ReceiveActor
{
_queryService = queryService;
// The query is synchronous SQLite I/O (a keyword search can scan millions of
// rows), so run it on the thread pool and pipe the reply back rather than pinning
// an Akka dispatcher thread (review 2026-10-21 02/P1). ExecuteQuery never throws —
// it returns Success:false — so no failure mapper is needed beyond the safety net.
Receive<EventLogQueryRequest>(msg =>
{
var response = _queryService.ExecuteQuery(msg);
Sender.Tell(response);
var service = _queryService;
Task.Run(() => service.ExecuteQuery(msg)).PipeTo(Sender);
});
}
}