From 8899ce5089091e21eae088da692468565401abba Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Fri, 19 Jan 2024 15:45:42 +0000 Subject: fix: add acquire timeout to sqlite database connection (#1590) * fix: add acquire timeout to sqlite database connection This should fix #1503 I wasn't able to trigger enough IO pressure for the SQL connection to be a problem. This adds `local_timeout` to the client config. This is a float, and represents the number of seconds (units in line with the other timeouts, though those are ints). Users may well want to reduce this if they regularly have issues, but by default I think 2s is fine and avoids a non-responsive system in bad situations. * tests --- atuin-client/src/kv.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'atuin-client/src/kv.rs') diff --git a/atuin-client/src/kv.rs b/atuin-client/src/kv.rs index cee7063d..26d6076b 100644 --- a/atuin-client/src/kv.rs +++ b/atuin-client/src/kv.rs @@ -221,7 +221,7 @@ mod tests { #[tokio::test] async fn build_kv() { - let mut store = SqliteStore::new(":memory:").await.unwrap(); + let mut store = SqliteStore::new(":memory:", 0.1).await.unwrap(); let kv = KvStore::new(); let key: [u8; 32] = XSalsa20Poly1305::generate_key(&mut OsRng).into(); let host_id = atuin_common::record::HostId(atuin_common::utils::uuid_v7()); -- cgit v1.3.1