diff --git a/dump/src/reader/v5/tasks.rs b/dump/src/reader/v5/tasks.rs index 61397dd24..528a870fc 100644 --- a/dump/src/reader/v5/tasks.rs +++ b/dump/src/reader/v5/tasks.rs @@ -147,6 +147,38 @@ impl Task { _ => None, } } + + pub fn created_at(&self) -> Option { + match &self.content { + TaskContent::IndexCreation { index_uid: _, primary_key: _ } => { + match self.events.first() { + Some(TaskEvent::Created(ts)) => Some(*ts), + _ => None, + } + } + TaskContent::DocumentAddition { + index_uid: _, + content_uuid: _, + merge_strategy: _, + primary_key: _, + documents_count: _, + allow_index_creation: _, + } => match self.events.first() { + Some(TaskEvent::Created(ts)) => Some(*ts), + _ => None, + }, + TaskContent::SettingsUpdate { + index_uid: _, + settings: _, + is_deletion: _, + allow_index_creation: _, + } => match self.events.first() { + Some(TaskEvent::Created(ts)) => Some(*ts), + _ => None, + }, + _ => None, + } + } } impl IndexUid {