From 8a14f6f5455c6c0bfed015a67944b5e26002ffc1 Mon Sep 17 00:00:00 2001 From: funilrys Date: Sun, 13 Nov 2022 10:12:51 +0100 Subject: [PATCH] Add Task.processed_at. --- dump/src/reader/v4/mod.rs | 2 ++ dump/src/reader/v4/tasks.rs | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/dump/src/reader/v4/mod.rs b/dump/src/reader/v4/mod.rs index 34df609b1..885f59d97 100644 --- a/dump/src/reader/v4/mod.rs +++ b/dump/src/reader/v4/mod.rs @@ -174,6 +174,8 @@ impl V4IndexReader { } if task.id as usize == index_metadata.creation_task_id { + created_at = task.processed_at(); + break; } } diff --git a/dump/src/reader/v4/tasks.rs b/dump/src/reader/v4/tasks.rs index c075fecc7..be98f9ee2 100644 --- a/dump/src/reader/v4/tasks.rs +++ b/dump/src/reader/v4/tasks.rs @@ -104,6 +104,13 @@ impl Task { }) } + pub fn processed_at(&self) -> Option { + match self.events.last() { + Some(TaskEvent::Succeded { result: _, timestamp }) => Some(timestamp.clone()), + _ => None, + } + } + pub fn updated_at(&self) -> Option { match self.events.last() { Some(TaskEvent::Created(ts)) => Some(*ts),