hive-agent: run the event store in WAL and give turn-stats writes a busy timeout
This commit is contained in:
parent
161dd8c44b
commit
62ab45297c
6 changed files with 110 additions and 0 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue