update the test with the stats

This commit is contained in:
Tamo 2025-01-20 15:15:45 +01:00 committed by Louis Dureuil
parent 0cc25c7e4c
commit cfc1e193b6
No known key found for this signature in database
5 changed files with 56 additions and 17 deletions

View file

@ -19,8 +19,18 @@ impl IndexScheduler {
indexes.len() as u32,
));
let index = self.index(uid)?;
milli::update::upgrade::upgrade(&index, progress.clone())
let mut wtxn = index.write_txn()?;
let regenerate = milli::update::upgrade::upgrade(&mut wtxn, &index, progress.clone())
.map_err(|e| Error::from_milli(e, Some(uid.to_string())))?;
if regenerate {
let stats = crate::index_mapper::IndexStats::new(&index, &wtxn)
.map_err(|e| Error::from_milli(e, Some(uid.to_string())))?;
// Release wtxn as soon as possible because it stops us from registering tasks
let mut index_schd_wtxn = self.env.write_txn()?;
self.index_mapper.store_stats_of(&mut index_schd_wtxn, uid, &stats)?;
index_schd_wtxn.commit()?;
}
wtxn.commit()?;
}
Ok(())