feat: event-driven parity, Windows shell detection, dirty build timestamps, and gatekeeper integration
This commit is contained in:
1 parent
64857f9d5e
commit
f4dcf3acbf
33 files changed
+3501
-143
No files matched your search
@@ -179,6 +179,34 @@ impl MemoryIndex {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn index_clipboard_image(
|
||||
&self,
|
||||
id: &str,
|
||||
file_path: &str,
|
||||
ocr_text: &str,
|
||||
) -> tokio::task::JoinHandle<tantivy::Result<()>> {
|
||||
let writer = Arc::clone(&self.writer);
|
||||
let id_field = self.id_field;
|
||||
let id_val = id.to_string();
|
||||
let needs_commit = Arc::clone(&self.needs_commit);
|
||||
|
||||
let doc = doc!(
|
||||
self.id_field => id,
|
||||
self.title_field => format!("Clipboard Screenshot: {}", file_path),
|
||||
self.body_field => ocr_text,
|
||||
self.type_field => "clipboard_image",
|
||||
self.namespace_field => "global"
|
||||
);
|
||||
|
||||
tokio::task::spawn_blocking(move || {
|
||||
let writer = writer.lock().unwrap_or_else(|e| e.into_inner());
|
||||
writer.delete_term(tantivy::Term::from_field_text(id_field, &id_val));
|
||||
writer.add_document(doc)?;
|
||||
needs_commit.store(true, std::sync::atomic::Ordering::SeqCst);
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
|
||||
pub fn delete_document(&self, id: &str) -> tokio::task::JoinHandle<tantivy::Result<()>> {
|
||||
let writer = Arc::clone(&self.writer);
|
||||
let id_field = self.id_field;
|
||||
|
||||
Reference in new issue
Block a user