mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 00:55:00 +08:00
Pass IndexStat by ref in store_stats_of
This commit is contained in:
parent
76288fad72
commit
7faa9a22f6
@ -850,7 +850,7 @@ impl IndexScheduler {
|
|||||||
let index_rtxn = index.read_txn()?;
|
let index_rtxn = index.read_txn()?;
|
||||||
let stats = crate::index_mapper::IndexStats::new(&index, &index_rtxn)?;
|
let stats = crate::index_mapper::IndexStats::new(&index, &index_rtxn)?;
|
||||||
let mut wtxn = self.env.write_txn()?;
|
let mut wtxn = self.env.write_txn()?;
|
||||||
self.index_mapper.store_stats_of(&mut wtxn, &index_uid, stats)?;
|
self.index_mapper.store_stats_of(&mut wtxn, &index_uid, &stats)?;
|
||||||
wtxn.commit()?;
|
wtxn.commit()?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}();
|
}();
|
||||||
@ -905,7 +905,7 @@ impl IndexScheduler {
|
|||||||
let mut wtxn = self.env.write_txn()?;
|
let mut wtxn = self.env.write_txn()?;
|
||||||
let index_rtxn = index.read_txn()?;
|
let index_rtxn = index.read_txn()?;
|
||||||
let stats = crate::index_mapper::IndexStats::new(&index, &index_rtxn)?;
|
let stats = crate::index_mapper::IndexStats::new(&index, &index_rtxn)?;
|
||||||
self.index_mapper.store_stats_of(&mut wtxn, &index_uid, stats)?;
|
self.index_mapper.store_stats_of(&mut wtxn, &index_uid, &stats)?;
|
||||||
wtxn.commit()?;
|
wtxn.commit()?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}();
|
}();
|
||||||
|
@ -432,14 +432,14 @@ impl IndexMapper {
|
|||||||
&self,
|
&self,
|
||||||
wtxn: &mut RwTxn,
|
wtxn: &mut RwTxn,
|
||||||
index_uid: &str,
|
index_uid: &str,
|
||||||
stats: IndexStats,
|
stats: &IndexStats,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let uuid = self
|
let uuid = self
|
||||||
.index_mapping
|
.index_mapping
|
||||||
.get(wtxn, index_uid)?
|
.get(wtxn, index_uid)?
|
||||||
.ok_or_else(|| Error::IndexNotFound(index_uid.to_string()))?;
|
.ok_or_else(|| Error::IndexNotFound(index_uid.to_string()))?;
|
||||||
|
|
||||||
self.index_stats.put(wtxn, &uuid, &stats)?;
|
self.index_stats.put(wtxn, &uuid, stats)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user