feat: add log retention and delete them after 90 days (#10151)

This commit is contained in:
jif-oai authored and GitHub committed 2026-01-29 16:55:01 +01:00
1 parent 89c5f3c4d4
commit d6631fb5a9
2 files changed
+21 -1

No files matched your search

+8
View File
@@ -231,6 +231,14 @@ FROM threads
Ok(())
}
pub(crate) async fn delete_logs_before(&self, cutoff_ts: i64) -> anyhow::Result<u64> {
let result = sqlx::query("DELETE FROM logs WHERE ts < ?")
.bind(cutoff_ts)
.execute(self.pool.as_ref())
.await?;
Ok(result.rows_affected())
}
/// List thread ids using the underlying database (no rollout scanning).
pub async fn list_thread_ids(
&self,