mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Add Task.processed_at.
This commit is contained in:
parent
079357ee1f
commit
8a14f6f545
2 changed files with 9 additions and 0 deletions
|
@ -174,6 +174,8 @@ impl V4IndexReader {
|
|||
}
|
||||
|
||||
if task.id as usize == index_metadata.creation_task_id {
|
||||
created_at = task.processed_at();
|
||||
|
||||
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> {
|
||||
match self.events.last() {
|
||||
Some(TaskEvent::Created(ts)) => Some(*ts),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue