mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 03:47:02 +02:00
update the test with the stats
This commit is contained in:
parent
0cc25c7e4c
commit
cfc1e193b6
5 changed files with 56 additions and 17 deletions
|
@ -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(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue