From 4e175ae88250720a5977bc97151df0eeb3a590b5 Mon Sep 17 00:00:00 2001 From: amab8901 Date: Fri, 16 Dec 2022 08:20:13 +0100 Subject: [PATCH] Replace Index::new_with_creation_dates(...) with Index::new(...) --- index-scheduler/src/index_mapper.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/index-scheduler/src/index_mapper.rs b/index-scheduler/src/index_mapper.rs index 8979dd6ce..95fc3b754 100644 --- a/index-scheduler/src/index_mapper.rs +++ b/index-scheduler/src/index_mapper.rs @@ -71,9 +71,12 @@ impl IndexMapper { options.map_size(clamp_to_page_size(self.index_size)); options.max_readers(1024); - let (created, updated) = date.unwrap(); - - Ok(Index::new_with_creation_dates(options, path, created, updated)?) + if date == None { + Ok(Index::new(options, path)?) + } else { + let (created, updated) = date.unwrap(); + Ok(Index::new_with_creation_dates(options, path, created, updated)?) + } } /// Get or create the index.