From 5a2972fc1929aaa9a2a1a11b91b4b903f0135d43 Mon Sep 17 00:00:00 2001 From: ad hoc Date: Thu, 26 May 2022 11:50:04 +0200 Subject: [PATCH] use TaskEvent method instead of variants in BatchHandler impl --- .../src/tasks/handlers/index_resolver_handler.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/meilisearch-lib/src/tasks/handlers/index_resolver_handler.rs b/meilisearch-lib/src/tasks/handlers/index_resolver_handler.rs index a34082afe..e0471567b 100644 --- a/meilisearch-lib/src/tasks/handlers/index_resolver_handler.rs +++ b/meilisearch-lib/src/tasks/handlers/index_resolver_handler.rs @@ -1,5 +1,3 @@ -use time::OffsetDateTime; - use crate::index_resolver::IndexResolver; use crate::index_resolver::{index_store::IndexStore, meta_store::IndexMetaStore}; use crate::tasks::batch::{Batch, BatchContent}; @@ -27,16 +25,8 @@ where .await; } BatchContent::IndexUpdate(ref mut task) => match self.process_task(task).await { - Ok(success) => { - task.events.push(TaskEvent::Succeded { - result: success, - timestamp: OffsetDateTime::now_utc(), - }); - } - Err(err) => task.events.push(TaskEvent::Failed { - error: err.into(), - timestamp: OffsetDateTime::now_utc(), - }), + Ok(success) => task.events.push(TaskEvent::succeeded(success)), + Err(err) => task.events.push(TaskEvent::failed(err.into())), }, _ => unreachable!(), }