mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 10:56:29 +03:00
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:
15
src/sql.rs
15
src/sql.rs
@@ -87,13 +87,6 @@ impl Sql {
|
|||||||
"PRAGMA cipher_memory_security = OFF; -- Too slow on Android
|
"PRAGMA cipher_memory_security = OFF; -- Too slow on Android
|
||||||
PRAGMA secure_delete=on;
|
PRAGMA secure_delete=on;
|
||||||
PRAGMA busy_timeout = {};
|
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
|
PRAGMA temp_store=memory; -- Avoid SQLITE_IOERR_GETTEMPPATH errors on Android
|
||||||
",
|
",
|
||||||
Duration::from_secs(10).as_millis()
|
Duration::from_secs(10).as_millis()
|
||||||
@@ -132,6 +125,14 @@ impl Sql {
|
|||||||
{
|
{
|
||||||
let conn = self.get_conn().await?;
|
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.
|
// journal_mode is persisted, it is sufficient to change it only for one handle.
|
||||||
conn.pragma_update(None, "journal_mode", &"WAL".to_string())?;
|
conn.pragma_update(None, "journal_mode", &"WAL".to_string())?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user