feat: move auto vaccum (#21378)

The initial vaccum is not needed anymore. We can consider all the DBs
have been reclaimed by now
This commit is contained in:
jif-oai
2026-05-06 19:32:28 +02:00
committed by GitHub
parent 0e821b380a
commit ab43db44a2
2 changed files with 7 additions and 20 deletions

View File

@@ -300,10 +300,10 @@ WHERE id IN (
return Ok(());
};
self.delete_logs_before(cutoff.timestamp()).await?;
sqlx::query("PRAGMA wal_checkpoint(TRUNCATE)")
.execute(self.logs_pool.as_ref())
.await?;
sqlx::query("PRAGMA incremental_vacuum")
// Startup cleanup should not wait behind or block foreground work.
// PASSIVE checkpoints copy whatever is immediately available and skip
// frames that would require waiting on active readers or writers.
sqlx::query("PRAGMA wal_checkpoint(PASSIVE)")
.execute(self.logs_pool.as_ref())
.await?;
Ok(())