From bef81065f9c2fbd542ccf6579b4a7a830c1adc5a Mon Sep 17 00:00:00 2001 From: Tamo Date: Tue, 6 Dec 2022 11:03:23 +0100 Subject: [PATCH] return the same time in case we didn't found a created or updated at --- dump/src/reader/v4/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dump/src/reader/v4/mod.rs b/dump/src/reader/v4/mod.rs index 6f10477ad..4dfbf3502 100644 --- a/dump/src/reader/v4/mod.rs +++ b/dump/src/reader/v4/mod.rs @@ -182,11 +182,13 @@ impl V4IndexReader { } } + let current_time = OffsetDateTime::now_utc(); + let metadata = IndexMetadata { uid: name, primary_key: meta.primary_key, - created_at: created_at.unwrap_or_else(OffsetDateTime::now_utc), - updated_at: updated_at.unwrap_or_else(OffsetDateTime::now_utc), + created_at: created_at.unwrap_or(current_time), + updated_at: updated_at.unwrap_or(current_time), }; let ret = V4IndexReader {