mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-18 08:48:32 +08:00
Add Task.processed_at.
This commit is contained in:
parent
079357ee1f
commit
8a14f6f545
@ -174,6 +174,8 @@ impl V4IndexReader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if task.id as usize == index_metadata.creation_task_id {
|
if task.id as usize == index_metadata.creation_task_id {
|
||||||
|
created_at = task.processed_at();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,13 @@ impl Task {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn processed_at(&self) -> Option<OffsetDateTime> {
|
||||||
|
match self.events.last() {
|
||||||
|
Some(TaskEvent::Succeded { result: _, timestamp }) => Some(timestamp.clone()),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn updated_at(&self) -> Option<OffsetDateTime> {
|
pub fn updated_at(&self) -> Option<OffsetDateTime> {
|
||||||
match self.events.last() {
|
match self.events.last() {
|
||||||
Some(TaskEvent::Created(ts)) => Some(*ts),
|
Some(TaskEvent::Created(ts)) => Some(*ts),
|
||||||
|
Loading…
Reference in New Issue
Block a user