mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
remove typo in BatchContent variant
This commit is contained in:
parent
3015265bde
commit
6b2016b350
5 changed files with 12 additions and 12 deletions
|
@ -14,14 +14,14 @@ where
|
|||
{
|
||||
fn accept(&self, batch: &Batch) -> bool {
|
||||
match batch.content {
|
||||
BatchContent::DocumentAddtitionBatch(_) | BatchContent::IndexUpdate(_) => true,
|
||||
BatchContent::DocumentsAdditionBatch(_) | BatchContent::IndexUpdate(_) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
async fn process_batch(&self, mut batch: Batch) -> Batch {
|
||||
match batch.content {
|
||||
BatchContent::DocumentAddtitionBatch(ref mut tasks) => {
|
||||
BatchContent::DocumentsAdditionBatch(ref mut tasks) => {
|
||||
*tasks = self
|
||||
.process_document_addition_batch(std::mem::take(tasks))
|
||||
.await;
|
||||
|
@ -45,7 +45,7 @@ where
|
|||
}
|
||||
|
||||
async fn finish(&self, batch: &Batch) {
|
||||
if let BatchContent::DocumentAddtitionBatch(ref tasks) = batch.content {
|
||||
if let BatchContent::DocumentsAdditionBatch(ref tasks) = batch.content {
|
||||
for task in tasks {
|
||||
if let Some(content_uuid) = task.get_content_uuid() {
|
||||
if let Err(e) = self.file_store.delete(content_uuid).await {
|
||||
|
@ -86,7 +86,7 @@ mod test {
|
|||
let index_resolver = IndexResolver::new(meta_store, index_store, update_file_store);
|
||||
|
||||
match batch.content {
|
||||
BatchContent::DocumentAddtitionBatch(_)
|
||||
BatchContent::DocumentsAdditionBatch(_)
|
||||
| BatchContent::IndexUpdate(_) => assert!(index_resolver.accept(&batch)),
|
||||
BatchContent::Dump(_)
|
||||
| BatchContent::Snapshot(_)
|
||||
|
|
|
@ -15,7 +15,7 @@ mod test {
|
|||
pub fn task_to_batch(task: Task) -> Batch {
|
||||
let content = match task.content {
|
||||
TaskContent::DocumentAddition { .. } => {
|
||||
BatchContent::DocumentAddtitionBatch(vec![task])
|
||||
BatchContent::DocumentsAdditionBatch(vec![task])
|
||||
}
|
||||
TaskContent::DocumentDeletion(_)
|
||||
| TaskContent::SettingsUpdate { .. }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue