Revert flaky "sql: enable auto_vacuum on all connections"

It results in "database is locked" errors on CI.

This reverts commit ce0984f02f.
This commit is contained in:
link2xt
2022-01-07 00:18:21 +03:00
parent ce0984f02f
commit 652d67a20f

View File

@@ -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())?;