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/settings.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'atuin-client/src/settings.rs') diff --git a/atuin-client/src/settings.rs b/atuin-client/src/settings.rs index 36bbd826..e57b61e3 100644 --- a/atuin-client/src/settings.rs +++ b/atuin-client/src/settings.rs @@ -244,6 +244,7 @@ pub struct Settings { pub network_connect_timeout: u64, pub network_timeout: u64, + pub local_timeout: f64, pub enter_accept: bool, #[serde(default)] @@ -456,6 +457,7 @@ impl Settings { .set_default("secrets_filter", true)? .set_default("network_connect_timeout", 5)? .set_default("network_timeout", 30)? + .set_default("local_timeout", 2.0)? // enter_accept defaults to false here, but true in the default config file. The dissonance is // intentional! // Existing users will get the default "False", so we don't mess with any potential -- cgit v1.3.1