Revert "Enable write-ahead logging for keystore db."
This reverts commit 6a50983169bc64f50b3747f6079df7a0a35c86b6.
Reason for revert: Bug 187889158. We forgot to account for database locks in the WAL mode set, and apparently some devices are running into locked dbs.
Change-Id: I43f8cb231397adc69ac6286b64a943cff55629c1
diff --git a/keystore2/src/database.rs b/keystore2/src/database.rs
index b6c459a..4ab4258 100644
--- a/keystore2/src/database.rs
+++ b/keystore2/src/database.rs
@@ -987,12 +987,6 @@
return Err(e);
}
}
- let result: String = conn
- .pragma_update_and_check(None, "journal_mode", &"WAL", |row| row.get(0))
- .expect("Attempting to set journal mode failed.");
- if result != "wal" {
- error!("Failed to put DB in WAL mode. This will make keystore slow.");
- }
break;
}
diff --git a/keystore2/vpnprofilestore/lib.rs b/keystore2/vpnprofilestore/lib.rs
index 5883ee1..8b3bc2b 100644
--- a/keystore2/vpnprofilestore/lib.rs
+++ b/keystore2/vpnprofilestore/lib.rs
@@ -24,7 +24,6 @@
};
use anyhow::{Context, Result};
use keystore2::{async_task::AsyncTask, legacy_blob::LegacyBlobLoader, utils::watchdog as wd};
-use log::error;
use rusqlite::{
params, Connection, OptionalExtension, Transaction, TransactionBehavior, NO_PARAMS,
};
@@ -47,15 +46,6 @@
db.conn.busy_handler(None).context("Failed to set busy handler.")?;
db.init_tables().context("Trying to initialize vpnstore db.")?;
-
- let result: String = db
- .conn
- .pragma_update_and_check(None, "journal_mode", &"WAL", |row| row.get(0))
- .expect("Attempting to set journal mode failed.");
- if result != "wal" {
- error!("Failed to put DB in WAL mode. This will make keystore slow.");
- }
-
Ok(db)
}