diff --git a/packages/nx/src/native/db/mod.rs b/packages/nx/src/native/db/mod.rs index 90ca66f32fa34..0c4838ee99756 100644 --- a/packages/nx/src/native/db/mod.rs +++ b/packages/nx/src/native/db/mod.rs @@ -1,6 +1,7 @@ use rusqlite::OpenFlags; use std::fs::{create_dir_all, remove_file}; use std::path::PathBuf; +use std::time::Duration; use crate::native::machine_id::get_machine_id; use napi::bindgen_prelude::External; @@ -80,5 +81,8 @@ fn create_connection(db_path: &PathBuf) -> anyhow::Result { // This makes things less synchronous than default c.pragma_update(None, "synchronous", "NORMAL")?; + c.busy_timeout(Duration::from_millis(25))?; + c.busy_handler(Some(|tries| tries < 6))?; + Ok(c) }