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) db: PatchDb,
|
||||||
pub(crate) locks: Vec<Guard>,
|
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]
|
#[async_trait]
|
||||||
impl DbHandle for PatchDbHandle {
|
impl DbHandle for PatchDbHandle {
|
||||||
async fn begin<'a>(&'a mut self) -> Result<Transaction<&'a mut Self>, Error> {
|
async fn begin<'a>(&'a mut self) -> Result<Transaction<&'a mut Self>, Error> {
|
||||||
|
|||||||
@@ -200,12 +200,8 @@ impl Node {
|
|||||||
) -> Vec<Request> {
|
) -> Vec<Request> {
|
||||||
let mut res = Vec::new();
|
let mut res = Vec::new();
|
||||||
for req in std::mem::take(&mut self.reqs) {
|
for req in std::mem::take(&mut self.reqs) {
|
||||||
if (req.lock_info.write() && self.write_available(req.lock_info.handle_id))
|
if let Some(req) = self.handle_request(req, locks_on_lease) {
|
||||||
|| self.read_available(req.lock_info.handle_id)
|
res.push(req);
|
||||||
{
|
|
||||||
if let Some(req) = self.handle_request(req, locks_on_lease) {
|
|
||||||
res.push(req);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
res
|
res
|
||||||
|
|||||||
Reference in New Issue
Block a user