mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
sql: set PRAGMA temp_store=memory
On Android, there is to /tmp directory, so SQLite may throw SQLITE_IOERR_GETTEMPPATH when trying to find a place for temporary files. Storing temporary files in memory is a workaround that always works (until out of memory). See https://github.com/mozilla/mentat/issues/505 for discussion of a similar issue.
This commit is contained in:
committed by
link2xt
parent
efcdb45301
commit
238c4bb792
@@ -678,7 +678,10 @@ async fn open(
|
|||||||
.with_flags(open_flags)
|
.with_flags(open_flags)
|
||||||
.with_init(|c| {
|
.with_init(|c| {
|
||||||
c.execute_batch(&format!(
|
c.execute_batch(&format!(
|
||||||
"PRAGMA secure_delete=on; PRAGMA busy_timeout = {};",
|
"PRAGMA secure_delete=on;
|
||||||
|
PRAGMA busy_timeout = {};
|
||||||
|
PRAGMA temp_store=memory; -- Avoid SQLITE_IOERR_GETTEMPPATH errors on Android
|
||||||
|
",
|
||||||
Duration::from_secs(10).as_millis()
|
Duration::from_secs(10).as_millis()
|
||||||
))?;
|
))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user