diff --git a/patch-db/src/handle.rs b/patch-db/src/handle.rs index c843962..07688fe 100644 --- a/patch-db/src/handle.rs +++ b/patch-db/src/handle.rs @@ -152,7 +152,14 @@ pub struct PatchDbHandle { pub(crate) db: PatchDb, pub(crate) locks: Vec, } - +impl std::fmt::Debug for PatchDbHandle { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("PatchDbHandle") + .field("id", &self.id) + .field("locks", &self.locks) + .finish() + } +} #[async_trait] impl DbHandle for PatchDbHandle { async fn begin<'a>(&'a mut self) -> Result, Error> { diff --git a/patch-db/src/locker.rs b/patch-db/src/locker.rs index 3a83d55..0979011 100644 --- a/patch-db/src/locker.rs +++ b/patch-db/src/locker.rs @@ -200,12 +200,8 @@ impl Node { ) -> Vec { let mut res = Vec::new(); for req in std::mem::take(&mut self.reqs) { - if (req.lock_info.write() && self.write_available(req.lock_info.handle_id)) - || self.read_available(req.lock_info.handle_id) - { - if let Some(req) = self.handle_request(req, locks_on_lease) { - res.push(req); - } + if let Some(req) = self.handle_request(req, locks_on_lease) { + res.push(req); } } res