mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-26 10:21:53 +00:00
more logging
This commit is contained in:
@@ -177,6 +177,9 @@ impl Store {
|
|||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "log")]
|
||||||
|
log::trace!("Attempting to apply patch: {:?}", patch);
|
||||||
|
|
||||||
self.check_cache_corrupted()?;
|
self.check_cache_corrupted()?;
|
||||||
let patch_bin = serde_cbor::to_vec(&*patch)?;
|
let patch_bin = serde_cbor::to_vec(&*patch)?;
|
||||||
json_patch::patch(self.get_data_mut()?, &*patch)?;
|
json_patch::patch(self.get_data_mut()?, &*patch)?;
|
||||||
@@ -274,8 +277,6 @@ impl PatchDb {
|
|||||||
} else {
|
} else {
|
||||||
self.store.write().await
|
self.store.write().await
|
||||||
};
|
};
|
||||||
#[cfg(feature = "log")]
|
|
||||||
log::trace!("Attempting to apply patch: {:?}", patch);
|
|
||||||
let rev = store.apply(patch, expire_id).await?;
|
let rev = store.apply(patch, expire_id).await?;
|
||||||
if let Some(rev) = rev.as_ref() {
|
if let Some(rev) = rev.as_ref() {
|
||||||
self.subscriber.send(rev.clone()).unwrap_or_default(); // ignore errors
|
self.subscriber.send(rev.clone()).unwrap_or_default(); // ignore errors
|
||||||
|
|||||||
@@ -146,7 +146,13 @@ impl<Parent: DbHandle + Send + Sync> DbHandle for Transaction<Parent> {
|
|||||||
self.rebase()?;
|
self.rebase()?;
|
||||||
self.parent.get_value(ptr, Some(store)).await?
|
self.parent.get_value(ptr, Some(store)).await?
|
||||||
};
|
};
|
||||||
json_patch::patch(&mut data, &*self.updates.for_path(ptr))?;
|
let path_updates = self.updates.for_path(ptr);
|
||||||
|
if !(path_updates.0).0.is_empty() {
|
||||||
|
#[cfg(feature = "log")]
|
||||||
|
log::trace!("applying patch {:?} at path {}", path_updates, ptr);
|
||||||
|
|
||||||
|
json_patch::patch(&mut data, &*path_updates)?;
|
||||||
|
}
|
||||||
Ok(data)
|
Ok(data)
|
||||||
}
|
}
|
||||||
async fn put_value<S: AsRef<str> + Send + Sync, V: SegList + Send + Sync>(
|
async fn put_value<S: AsRef<str> + Send + Sync, V: SegList + Send + Sync>(
|
||||||
|
|||||||
Reference in New Issue
Block a user