Watch
0
0
Fork
You've already forked hyperhive
0

hive-agent: run the event store in WAL and give turn-stats writes a busy timeout

This commit is contained in:
damocles 2026-10-18 01:36:41 +02:00
commit 62ab45297c
6 changed files with 110 additions and 0 deletions

View file

@ -169,6 +169,7 @@ fn delete_trio(dir: &Path, stem: &str) {
/// agent's `events.sqlite`. Returns the number of rows deleted.
fn vacuum_events(path: &Path) -> Result<u64> {
let conn = Connection::open(path)?;
crate::sqlite_writer::configure_wal(&conn)?;
let cutoff = chrono::Utc::now().timestamp() - STREAM_KEEP_SECS;
let removed = conn.execute(
"DELETE FROM events WHERE kind = 'stream' AND ts < ?1",