From 0c03ed3c1ed01f1d81733cbfd01e10754a71e4fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Thu, 18 Aug 2022 11:14:53 +0200 Subject: [PATCH] Hide the batch_uid field from the tasks route --- meilisearch-http/src/task.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/meilisearch-http/src/task.rs b/meilisearch-http/src/task.rs index 08009f7da..fe23720aa 100644 --- a/meilisearch-http/src/task.rs +++ b/meilisearch-http/src/task.rs @@ -4,7 +4,6 @@ use std::str::FromStr; use std::write; use meilisearch_lib::index::{Settings, Unchecked}; -use meilisearch_lib::tasks::batch::BatchId; use meilisearch_lib::tasks::task::{ DocumentDeletion, Task, TaskContent, TaskEvent, TaskId, TaskResult, }; @@ -12,8 +11,6 @@ use meilisearch_types::error::ResponseError; use serde::{Deserialize, Serialize, Serializer}; use time::{Duration, OffsetDateTime}; -use crate::AUTOBATCHING_ENABLED; - #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub enum TaskType { @@ -230,8 +227,6 @@ pub struct TaskView { started_at: Option, #[serde(serialize_with = "time::serde::rfc3339::option::serialize")] finished_at: Option, - #[serde(skip_serializing_if = "Option::is_none")] - batch_uid: Option, } impl From for TaskView { @@ -380,16 +375,6 @@ impl From for TaskView { let duration = finished_at.zip(started_at).map(|(tf, ts)| (tf - ts)); - let batch_uid = AUTOBATCHING_ENABLED - .load(std::sync::atomic::Ordering::Relaxed) - .then(|| { - events.iter().find_map(|e| match e { - TaskEvent::Batched { batch_id, .. } => Some(*batch_id), - _ => None, - }) - }) - .flatten(); - Self { uid: id, index_uid, @@ -401,7 +386,6 @@ impl From for TaskView { enqueued_at, started_at, finished_at, - batch_uid, } } }