From 2600a784a9899a6f8e0c9abe0bf4c4ce48cb85a9 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Tue, 10 Dec 2024 18:23:25 -0700 Subject: [PATCH] try-lock --- patch-db/src/store.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patch-db/src/store.rs b/patch-db/src/store.rs index 8c97117..978b385 100644 --- a/patch-db/src/store.rs +++ b/patch-db/src/store.rs @@ -45,11 +45,11 @@ impl Store { let mut lock = OPEN_STORES.lock().await; ( if let Some(open) = lock.get(&path) { - open.clone().lock_owned().await + open.clone().try_lock_owned()? } else { let tex = Arc::new(Mutex::new(())); lock.insert(path.clone(), tex.clone()); - tex.lock_owned().await + tex.try_lock_owned()? }, path, ) @@ -69,7 +69,7 @@ impl Store { .truncate(false) .open(&path)?, fd_lock_rs::LockType::Exclusive, - true, + false, )?; let mut stream = serde_cbor::StreamDeserializer::new(serde_cbor::de::IoRead::new(&mut *f));