refactor: remove redundant multi-line search index unwrap clones across all handlers via new get_search_index accessor
This commit is contained in:
1 parent
d96b4cf822
commit
0ba0ed5b3d
5 files changed
+12
-36
No files matched your search
@@ -123,6 +123,10 @@ impl MemoryState {
|
||||
self.graph.modify(update_fn);
|
||||
}
|
||||
|
||||
pub fn get_search_index(&self) -> MemoryIndex {
|
||||
self.search_index.read().unwrap_or_else(|e| e.into_inner()).clone()
|
||||
}
|
||||
|
||||
pub async fn rebuild_index(self: &Arc<Self>) {
|
||||
if let Ok(new_idx) = MemoryIndex::new(&self.base_dir) {
|
||||
let idx = new_idx.clone();
|
||||
|
||||
Reference in new issue
Block a user