mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-29 16:45:30 +08:00
Merge #2059
2059: change indexed doc count on error r=irevoire a=MarinPostma change `indexed_documents` and `deleted_documents` to return 0 instead of null when empty when the task has failed. close #2053 Co-authored-by: Marin Postma <postma.marin@protonmail.com>
This commit is contained in:
commit
56d223a51d
@ -215,6 +215,27 @@ impl From<Task> for TaskView {
|
|||||||
(TaskStatus::Succeeded, None, Some(*timestamp))
|
(TaskStatus::Succeeded, None, Some(*timestamp))
|
||||||
}
|
}
|
||||||
TaskEvent::Failed { timestamp, error } => {
|
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))
|
(TaskStatus::Failed, Some(error.clone()), Some(*timestamp))
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user