@@ -14,9 +14,18 @@ impl Querier {
|
||||
root: &str,
|
||||
path: impl IntoIterator<Item = impl Into<String>>,
|
||||
) -> Option<GraphItem> {
|
||||
let path = path.into_iter().map(|i| i.into()).collect::<Vec<String>>();
|
||||
let path = path
|
||||
.into_iter()
|
||||
.map(|i| i.into())
|
||||
.filter(|i| !i.is_empty())
|
||||
.collect::<Vec<String>>();
|
||||
|
||||
tracing::debug!("quering: {}, len: ({}))", path.join("."), path.len());
|
||||
tracing::debug!(
|
||||
"quering: root:({}), path:({}), len: ({}))",
|
||||
root,
|
||||
path.join("."),
|
||||
path.len()
|
||||
);
|
||||
|
||||
self.engine
|
||||
.get(root, &path.iter().map(|i| i.as_str()).collect::<Vec<_>>())
|
||||
|
@@ -10,6 +10,7 @@ pub struct LockFile(PathBuf);
|
||||
|
||||
impl Drop for LockFile {
|
||||
fn drop(&mut self) {
|
||||
tracing::debug!("removing lockfile");
|
||||
std::fs::remove_file(&self.0).expect("to be able to delete lockfile")
|
||||
}
|
||||
}
|
||||
@@ -76,6 +77,14 @@ impl Storage {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn clear_lock_file(self) {
|
||||
let mut lock_file = self.lock_file.lock().unwrap();
|
||||
|
||||
if lock_file.is_some() {
|
||||
*lock_file = None;
|
||||
}
|
||||
}
|
||||
|
||||
fn state(&self) -> anyhow::Result<PathBuf> {
|
||||
self.cache().map(|c| c.join("graph.json"))
|
||||
}
|
||||
|
Reference in New Issue
Block a user