Skip to content

Commit

Permalink
Set the synchronous option for the records DB connection to "normal".
Browse files Browse the repository at this point in the history
Just like atuinsh#1667, when connecting to a DB using WAL mode for journaling, the recommended setting for
synchronizing the data "NORMAL", while the default is "FULL", which causes hangs on ZFS systems.

The hangs are not as long or frequent as before atuinsh#1667, but are still present.
  • Loading branch information
nebkor committed Mar 24, 2024
1 parent 82a7c8d commit 119f0aa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion atuin-client/src/record/sqlite_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ use eyre::{eyre, Result};
use fs_err as fs;

use sqlx::{
sqlite::{SqliteConnectOptions, SqliteJournalMode, SqlitePool, SqlitePoolOptions, SqliteRow},
sqlite::{
SqliteConnectOptions, SqliteJournalMode, SqlitePool, SqlitePoolOptions, SqliteRow,
SqliteSynchronous,
},
Row,
};

Expand Down Expand Up @@ -42,6 +45,7 @@ impl SqliteStore {

let opts = SqliteConnectOptions::from_str(path.as_os_str().to_str().unwrap())?
.journal_mode(SqliteJournalMode::Wal)
.synchronous(SqliteSynchronous::Normal)
.foreign_keys(true)
.create_if_missing(true);

Expand Down

0 comments on commit 119f0aa

Please sign in to comment.