fix: filter deprecated processors from trigger API requests

This commit is contained in:
Accusys
2026-06-22 09:15:02 +08:00
parent 4ba248513e
commit c93b54efeb

View File

@@ -233,8 +233,16 @@ async fn trigger_processing(
.await .await
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
let valid: std::collections::HashSet<&str> = crate::core::db::ProcessorType::all()
.iter()
.map(|p| p.as_str())
.collect();
let processors_to_run: Vec<String> = if let Some(procs) = &req.processors { let processors_to_run: Vec<String> = if let Some(procs) = &req.processors {
procs.iter().map(|s| s.to_string()).collect() procs
.iter()
.filter(|s| valid.contains(s.as_str()))
.map(|s| s.to_string())
.collect()
} else { } else {
crate::core::db::ProcessorType::all() crate::core::db::ProcessorType::all()
.iter() .iter()