This commit is contained in:
Aiden McClelland
2024-12-10 18:23:25 -07:00
parent 99076d349c
commit 2600a784a9

View File

@@ -45,11 +45,11 @@ impl Store {
let mut lock = OPEN_STORES.lock().await; let mut lock = OPEN_STORES.lock().await;
( (
if let Some(open) = lock.get(&path) { if let Some(open) = lock.get(&path) {
open.clone().lock_owned().await open.clone().try_lock_owned()?
} else { } else {
let tex = Arc::new(Mutex::new(())); let tex = Arc::new(Mutex::new(()));
lock.insert(path.clone(), tex.clone()); lock.insert(path.clone(), tex.clone());
tex.lock_owned().await tex.try_lock_owned()?
}, },
path, path,
) )
@@ -69,7 +69,7 @@ impl Store {
.truncate(false) .truncate(false)
.open(&path)?, .open(&path)?,
fd_lock_rs::LockType::Exclusive, fd_lock_rs::LockType::Exclusive,
true, false,
)?; )?;
let mut stream = let mut stream =
serde_cbor::StreamDeserializer::new(serde_cbor::de::IoRead::new(&mut *f)); serde_cbor::StreamDeserializer::new(serde_cbor::de::IoRead::new(&mut *f));