From f558ff826abaaf5fa674db2e4f32084da9bcb9ad Mon Sep 17 00:00:00 2001 From: Marin Postma Date: Thu, 6 Jan 2022 13:18:47 +0100 Subject: [PATCH] feat(http): task view indexed and deleted documents return 0 instead of null --- meilisearch-http/src/task.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/meilisearch-http/src/task.rs b/meilisearch-http/src/task.rs index 7def064c2..990e9d0b7 100644 --- a/meilisearch-http/src/task.rs +++ b/meilisearch-http/src/task.rs @@ -215,6 +215,27 @@ impl From for TaskView { (TaskStatus::Succeeded, None, Some(*timestamp)) } TaskEvent::Failed { timestamp, error } => { + match details { + Some(TaskDetails::DocumentDeletion { + ref mut deleted_documents, + .. + }) => { + deleted_documents.replace(0); + } + Some(TaskDetails::ClearAll { + ref mut deleted_documents, + .. + }) => { + deleted_documents.replace(0); + } + Some(TaskDetails::DocumentAddition { + ref mut indexed_documents, + .. + }) => { + indexed_documents.replace(0); + } + _ => (), + } (TaskStatus::Failed, Some(error.clone()), Some(*timestamp)) } };