diff --git a/src/clients/detector.rs b/src/clients/detector.rs index 183f6c3c..2725f5b5 100644 --- a/src/clients/detector.rs +++ b/src/clients/detector.rs @@ -50,16 +50,11 @@ impl DetectorClient { #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct DetectorRequest { pub text: String, - pub parameters: Option>, + pub parameters: HashMap, } impl DetectorRequest { pub fn new(text: String, parameters: HashMap) -> Self { - let parameters = if parameters.is_empty() { - None - } else { - Some(parameters) - }; Self { text, parameters } } } diff --git a/src/orchestrator.rs b/src/orchestrator.rs index 6328cd5a..4afc3de1 100644 --- a/src/orchestrator.rs +++ b/src/orchestrator.rs @@ -308,7 +308,7 @@ async fn handle_chunk_task( Ok::, Error>(results) } }) - .buffer_unordered(5) + .buffered(5) .collect::>() .await .into_iter() @@ -373,7 +373,7 @@ async fn handle_detection_task( Ok::, Error>(results) } }) - .buffer_unordered(5) + .buffered(5) .collect::>() .await .into_iter()