fix(sqlite): Add WAL checkpoints to the DBs when they're opened too

This commit is contained in:
Jorge Martín
2026-01-07 13:17:14 +01:00
committed by Jorge Martin Espinosa
parent 3be6fb1a80
commit b5a0042e14
4 changed files with 9 additions and 0 deletions
@@ -125,6 +125,8 @@ impl SqliteCryptoStore {
debug!("Opened sqlite store with version {}", version);
run_migrations(&conn, version).await?;
conn.wal_checkpoint().await;
let store_cipher = match secret {
Some(s) => Some(Arc::new(conn.get_or_create_store_cipher(s).await?)),
None => None,
@@ -149,8 +149,11 @@ impl SqliteEventCacheStore {
let conn = pool.get().await?;
let version = conn.db_version().await?;
run_migrations(&conn, version).await?;
conn.wal_checkpoint().await;
let store_cipher = match secret {
Some(s) => Some(Arc::new(conn.get_or_create_store_cipher(s).await?)),
None => None,
@@ -143,6 +143,8 @@ impl SqliteMediaStore {
let version = conn.db_version().await?;
run_migrations(&conn, version).await?;
conn.wal_checkpoint().await;
let store_cipher = match secret {
Some(s) => Some(Arc::new(conn.get_or_create_store_cipher(s).await?)),
None => None,
@@ -160,6 +160,8 @@ impl SqliteStateStore {
};
this.run_migrations(version, None).await?;
this.read().await?.wal_checkpoint().await;
Ok(this)
}