mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
rename Succeded to Succeeded
This commit is contained in:
parent
ab39df9693
commit
446f1f31e0
10 changed files with 111 additions and 17 deletions
|
@ -91,7 +91,7 @@ mod test {
|
|||
if accept {
|
||||
let batch = dump_handler.process_batch(batch).await;
|
||||
let last_event = batch.content.first().unwrap().events.last().unwrap();
|
||||
assert!(matches!(last_event, TaskEvent::Succeded { .. }));
|
||||
assert!(matches!(last_event, TaskEvent::Succeeded { .. }));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ pub enum TaskEvent {
|
|||
#[serde(with = "time::serde::rfc3339")]
|
||||
OffsetDateTime,
|
||||
),
|
||||
Succeded {
|
||||
Succeeded {
|
||||
result: TaskResult,
|
||||
#[cfg_attr(test, proptest(strategy = "test::datetime_strategy()"))]
|
||||
#[serde(with = "time::serde::rfc3339")]
|
||||
|
@ -64,7 +64,7 @@ pub enum TaskEvent {
|
|||
|
||||
impl TaskEvent {
|
||||
pub fn succeeded(result: TaskResult) -> Self {
|
||||
Self::Succeded {
|
||||
Self::Succeeded {
|
||||
result,
|
||||
timestamp: OffsetDateTime::now_utc(),
|
||||
}
|
||||
|
@ -106,7 +106,10 @@ impl Task {
|
|||
/// A task is finished when its last state is either `Succeeded` or `Failed`.
|
||||
pub fn is_finished(&self) -> bool {
|
||||
self.events.last().map_or(false, |event| {
|
||||
matches!(event, TaskEvent::Succeded { .. } | TaskEvent::Failed { .. })
|
||||
matches!(
|
||||
event,
|
||||
TaskEvent::Succeeded { .. } | TaskEvent::Failed { .. }
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue