Keystore 2.0: Install database busy handler.
Make keystore DB poll every 50us for the database lock. Test: N/A Change-Id: Ibb6c8d438e4b3d99d80671b6720baad23cc17a0d
This commit is contained in:
parent
f3caf2698b
commit
aea2734a7c
1 changed files with 5 additions and 0 deletions
|
@ -617,6 +617,11 @@ impl KeystoreDB {
|
||||||
perboot_path_str.push_str(&perboot_path.to_string_lossy());
|
perboot_path_str.push_str(&perboot_path.to_string_lossy());
|
||||||
|
|
||||||
let conn = Self::make_connection(&persistent_path_str, &perboot_path_str)?;
|
let conn = Self::make_connection(&persistent_path_str, &perboot_path_str)?;
|
||||||
|
conn.busy_handler(Some(|_| {
|
||||||
|
std::thread::sleep(std::time::Duration::from_micros(50));
|
||||||
|
true
|
||||||
|
}))
|
||||||
|
.context("In KeystoreDB::new: Failed to set busy handler.")?;
|
||||||
|
|
||||||
Self::init_tables(&conn)?;
|
Self::init_tables(&conn)?;
|
||||||
Ok(Self { conn })
|
Ok(Self { conn })
|
||||||
|
|
Loading…
Reference in a new issue