mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 12:05:05 +08:00
use TaskEvent method instead of variants in BatchHandler impl
This commit is contained in:
parent
1647ca3c1f
commit
5a2972fc19
@ -1,5 +1,3 @@
|
|||||||
use time::OffsetDateTime;
|
|
||||||
|
|
||||||
use crate::index_resolver::IndexResolver;
|
use crate::index_resolver::IndexResolver;
|
||||||
use crate::index_resolver::{index_store::IndexStore, meta_store::IndexMetaStore};
|
use crate::index_resolver::{index_store::IndexStore, meta_store::IndexMetaStore};
|
||||||
use crate::tasks::batch::{Batch, BatchContent};
|
use crate::tasks::batch::{Batch, BatchContent};
|
||||||
@ -27,16 +25,8 @@ where
|
|||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
BatchContent::IndexUpdate(ref mut task) => match self.process_task(task).await {
|
BatchContent::IndexUpdate(ref mut task) => match self.process_task(task).await {
|
||||||
Ok(success) => {
|
Ok(success) => task.events.push(TaskEvent::succeeded(success)),
|
||||||
task.events.push(TaskEvent::Succeded {
|
Err(err) => task.events.push(TaskEvent::failed(err.into())),
|
||||||
result: success,
|
|
||||||
timestamp: OffsetDateTime::now_utc(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
Err(err) => task.events.push(TaskEvent::Failed {
|
|
||||||
error: err.into(),
|
|
||||||
timestamp: OffsetDateTime::now_utc(),
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user