mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
Use an RoTxn to retrieve the number of documents
This commit is contained in:
parent
b79a8457f9
commit
dd74af4c70
1 changed files with 1 additions and 1 deletions
|
@ -75,7 +75,7 @@ impl Main {
|
||||||
Ok(new)
|
Ok(new)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn number_of_documents(&self, reader: &zlmdb::RwTxn) -> ZResult<u64> {
|
pub fn number_of_documents(&self, reader: &zlmdb::RoTxn) -> ZResult<u64> {
|
||||||
match self.main.get::<Str, OwnedType<u64>>(reader, NUMBER_OF_DOCUMENTS_KEY)? {
|
match self.main.get::<Str, OwnedType<u64>>(reader, NUMBER_OF_DOCUMENTS_KEY)? {
|
||||||
Some(value) => Ok(value),
|
Some(value) => Ok(value),
|
||||||
None => Ok(0),
|
None => Ok(0),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue