From 1fcd5f091ec158e8f0bb2c2942d727ac0506c89b Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Tue, 12 Nov 2024 12:23:13 +0100 Subject: [PATCH] Remove progress from task --- crates/index-scheduler/src/insta_snapshot.rs | 1 - crates/index-scheduler/src/lib.rs | 10 +--------- crates/index-scheduler/src/utils.rs | 2 -- crates/meilisearch-types/src/task_view.rs | 7 +------ crates/meilisearch-types/src/tasks.rs | 2 -- 5 files changed, 2 insertions(+), 20 deletions(-) diff --git a/crates/index-scheduler/src/insta_snapshot.rs b/crates/index-scheduler/src/insta_snapshot.rs index f63a289eb..f295e35b6 100644 --- a/crates/index-scheduler/src/insta_snapshot.rs +++ b/crates/index-scheduler/src/insta_snapshot.rs @@ -148,7 +148,6 @@ pub fn snapshot_task(task: &Task) -> String { enqueued_at: _, started_at: _, finished_at: _, - progress: _, error, canceled_by, details, diff --git a/crates/index-scheduler/src/lib.rs b/crates/index-scheduler/src/lib.rs index 9e78d4b48..b57a0fe9f 100644 --- a/crates/index-scheduler/src/lib.rs +++ b/crates/index-scheduler/src/lib.rs @@ -978,12 +978,7 @@ impl IndexScheduler { Ok(( ret.map(|task| { if processing.contains(task.uid) { - Task { - status: Status::Processing, - progress: progress.clone(), - started_at: Some(started_at), - ..task - } + Task { status: Status::Processing, started_at: Some(started_at), ..task } } else { task } @@ -1025,7 +1020,6 @@ impl IndexScheduler { enqueued_at: OffsetDateTime::now_utc(), started_at: None, finished_at: None, - progress: None, error: None, canceled_by: None, details: kind.default_details(), @@ -1606,8 +1600,6 @@ impl<'a> Dump<'a> { enqueued_at: task.enqueued_at, started_at: task.started_at, finished_at: task.finished_at, - /// FIXME: should we update dump to contain progress information? 🤔 - progress: None, error: task.error, canceled_by: task.canceled_by, details: task.details, diff --git a/crates/index-scheduler/src/utils.rs b/crates/index-scheduler/src/utils.rs index 7ae419495..788a70fb8 100644 --- a/crates/index-scheduler/src/utils.rs +++ b/crates/index-scheduler/src/utils.rs @@ -345,8 +345,6 @@ impl IndexScheduler { enqueued_at, started_at, finished_at, - /// FIXME: assert something here? ask tamo 🤔 - progress: _, error: _, canceled_by, details, diff --git a/crates/meilisearch-types/src/task_view.rs b/crates/meilisearch-types/src/task_view.rs index fd9367bf4..3075fa899 100644 --- a/crates/meilisearch-types/src/task_view.rs +++ b/crates/meilisearch-types/src/task_view.rs @@ -4,9 +4,7 @@ use time::{Duration, OffsetDateTime}; use crate::error::ResponseError; use crate::settings::{Settings, Unchecked}; -use crate::tasks::{ - serialize_duration, Details, IndexSwap, Kind, Status, Task, TaskId, TaskProgress, -}; +use crate::tasks::{serialize_duration, Details, IndexSwap, Kind, Status, Task, TaskId}; #[derive(Debug, Clone, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] @@ -29,8 +27,6 @@ pub struct TaskView { pub started_at: Option, #[serde(with = "time::serde::rfc3339::option", default)] pub finished_at: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub progress: Option, } impl TaskView { @@ -47,7 +43,6 @@ impl TaskView { enqueued_at: task.enqueued_at, started_at: task.started_at, finished_at: task.finished_at, - progress: task.progress.clone(), } } } diff --git a/crates/meilisearch-types/src/tasks.rs b/crates/meilisearch-types/src/tasks.rs index 56d839432..70e6ad294 100644 --- a/crates/meilisearch-types/src/tasks.rs +++ b/crates/meilisearch-types/src/tasks.rs @@ -31,8 +31,6 @@ pub struct Task { #[serde(with = "time::serde::rfc3339::option")] pub finished_at: Option, - pub progress: Option, - pub error: Option, pub canceled_by: Option, pub details: Option
,