fix(#2031): move bash-tasks + events vacuum agent-side (privsep ownership)

This commit is contained in:
damocles 2026-06-27 00:26:56 +02:00 committed by mara
commit 49fc61212b
9 changed files with 159 additions and 224 deletions

View file

@ -366,8 +366,7 @@ impl BuildLogs {
}
/// Drop rows past their retention window. Returns the number of
/// rows deleted. Called from the existing hourly vacuum loop —
/// see `events_vacuum` for the call site.
/// rows deleted. Called from this module's hourly `spawn` loop.
///
/// Rule:
/// - `status = 'fail'` rows kept for `KEEP_FAIL_SECS` past their
@ -395,10 +394,10 @@ impl BuildLogs {
}
}
/// Spawn the hourly retention sweep. Mirrors `events_vacuum::spawn` /
/// `events_vacuum::spawn` in cadence + shutdown handling. Runs once
/// at startup before its first sleep so a long-uptime instance
/// doesn't accumulate a backlog the first hour after restart.
/// Spawn the hourly retention sweep. A host-side sweep (build_logs.sqlite
/// is hive-c0re-owned, so no privsep ownership issue). Runs once at startup
/// before its first sleep so a long-uptime instance doesn't accumulate a
/// backlog the first hour after restart.
pub fn spawn_vacuum(coord: &Arc<crate::coordinator::Coordinator>) {
use std::time::Duration;
let logs = coord.build_logs.clone();