mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-26 02:11:54 +00:00
fix requests being dropped
This commit is contained in:
committed by
Aiden McClelland
parent
b77e433152
commit
99c7fe88a9
@@ -152,7 +152,14 @@ pub struct PatchDbHandle {
|
||||
pub(crate) db: PatchDb,
|
||||
pub(crate) locks: Vec<Guard>,
|
||||
}
|
||||
|
||||
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<Transaction<&'a mut Self>, Error> {
|
||||
|
||||
@@ -200,14 +200,10 @@ impl Node {
|
||||
) -> Vec<Request> {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
res
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user