Watch selected folders and reconcile bounded changes with media freshness guards
This commit is contained in:
1 parent
99748bd99f
commit
657de3de86
22 files changed
+2022
-149
No files matched your search
@@ -29,6 +29,7 @@ pub struct SemanticState {
|
||||
inference_budget: InferenceBudget,
|
||||
lifecycle: Mutex<()>,
|
||||
media_tools: Option<searchi_media::FfmpegTools>,
|
||||
media_limits: searchi_media::MediaLimits,
|
||||
media_setup_error: Option<String>,
|
||||
}
|
||||
|
||||
@@ -58,10 +59,17 @@ impl SemanticState {
|
||||
inference_budget: InferenceBudget::new(2),
|
||||
lifecycle: Mutex::new(()),
|
||||
media_tools,
|
||||
media_limits: searchi_media::MediaLimits::default(),
|
||||
media_setup_error,
|
||||
}
|
||||
}
|
||||
|
||||
/// Keep generated video frames below the application's excluded data tree.
|
||||
pub fn with_media_scratch(mut self, directory: PathBuf) -> Self {
|
||||
self.media_limits.scratch_directory = Some(directory);
|
||||
self
|
||||
}
|
||||
|
||||
fn ensure_idle(&self) -> Result<(), String> {
|
||||
if self.embedding.load(Ordering::Acquire)
|
||||
|| self.downloading.load(Ordering::Acquire)
|
||||
@@ -335,7 +343,7 @@ pub async fn index_embeddings(state: State<'_, AppState>) -> Result<EmbeddingRep
|
||||
let tools = semantic.media_tools.as_ref().ok_or_else(|| {
|
||||
anyhow::anyhow!("The media decoder is missing from this installation. Repair or reinstall searchi.")
|
||||
})?;
|
||||
service.index_embeddings_with_media(tools, &searchi_media::MediaLimits::default())
|
||||
service.index_embeddings_with_media(tools, &semantic.media_limits)
|
||||
})()
|
||||
.map_err(|error| error.to_string());
|
||||
// The publisher shares its prepared immutable ANN before activation.
|
||||
|
||||
Reference in new issue
Block a user