From a5403eb05f11fd7aeeb6ce8577f21c7623694d5c Mon Sep 17 00:00:00 2001 From: gwenn Date: Sat, 28 Jul 2018 17:02:17 +0200 Subject: [PATCH] Replace PRAGMA call by Rust busy_timeout function --- src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index aa52b4b..367258d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -993,6 +993,7 @@ mod test { #[test] fn test_concurrent_transactions_busy_commit() { + use std::time::Duration; let tmp = TempDir::new("locked").unwrap(); let path = tmp.path().join("transactions.db3"); @@ -1004,8 +1005,8 @@ mod test { let mut db1 = Connection::open(&path).unwrap(); let mut db2 = Connection::open(&path).unwrap(); - db1.execute_batch("PRAGMA busy_timeout = 0;").unwrap(); - db2.execute_batch("PRAGMA busy_timeout = 0;").unwrap(); + db1.busy_timeout(Duration::from_millis(0)).unwrap(); + db2.busy_timeout(Duration::from_millis(0)).unwrap(); { let tx1 = db1.transaction().unwrap();