Insert dump_reader.date() into create_raw_index(_) argument

This commit is contained in:
amab8901 2022-12-21 15:16:31 +01:00
parent 0893b175dc
commit df176aaf01

View File

@ -289,8 +289,13 @@ fn import_dump(
let mut index_reader = index_reader?; let mut index_reader = index_reader?;
let metadata = index_reader.metadata(); let metadata = index_reader.metadata();
log::info!("Importing index `{}`.", metadata.uid); log::info!("Importing index `{}`.", metadata.uid);
//let date = Some((time::OffsetDateTime::now_utc(), time::OffsetDateTime::now_utc())); let date;
let date = dump_reader.date(); if let Some(dump_reader_date) = dump_reader.date() {
date = Some((dump_reader_date, dump_reader_date));
} else {
date = Some((time::OffsetDateTime::now_utc(), time::OffsetDateTime::now_utc()));
}
let index = index_scheduler.create_raw_index(&metadata.uid, date)?; let index = index_scheduler.create_raw_index(&metadata.uid, date)?;
let mut wtxn = index.write_txn()?; let mut wtxn = index.write_txn()?;