From 652d67a20f8eaa8dcaa6fa93618ad6d2a48ba112 Mon Sep 17 00:00:00 2001 From: link2xt Date: Fri, 7 Jan 2022 00:18:21 +0300 Subject: [PATCH] Revert flaky "sql: enable auto_vacuum on all connections" It results in "database is locked" errors on CI. This reverts commit ce0984f02f62b72afe5db7745f152447740e760a. --- src/sql.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/sql.rs b/src/sql.rs index 729ec3b3b..a83945cac 100644 --- a/src/sql.rs +++ b/src/sql.rs @@ -87,13 +87,6 @@ impl Sql { "PRAGMA cipher_memory_security = OFF; -- Too slow on Android PRAGMA secure_delete=on; PRAGMA busy_timeout = {}; - -- Try to enable auto_vacuum. This will only be - -- applied if the database is new or after successful - -- VACUUM, which usually happens before backup export. - -- When auto_vacuum is INCREMENTAL, it is possible to - -- use PRAGMA incremental_vacuum to return unused - -- database pages to the filesystem. - PRAGMA auto_vacuum=INCREMENTAL; PRAGMA temp_store=memory; -- Avoid SQLITE_IOERR_GETTEMPPATH errors on Android ", Duration::from_secs(10).as_millis() @@ -132,6 +125,14 @@ impl Sql { { let conn = self.get_conn().await?; + // Try to enable auto_vacuum. This will only be + // applied if the database is new or after successful + // VACUUM, which usually happens before backup export. + // When auto_vacuum is INCREMENTAL, it is possible to + // use PRAGMA incremental_vacuum to return unused + // database pages to the filesystem. + conn.pragma_update(None, "auto_vacuum", &"INCREMENTAL".to_string())?; + // journal_mode is persisted, it is sufficient to change it only for one handle. conn.pragma_update(None, "journal_mode", &"WAL".to_string())?;