From dd74af4c707d7ed7b8af3d81f6301c0d2bd9a520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Thu, 17 Oct 2019 17:30:54 +0200 Subject: [PATCH] Use an RoTxn to retrieve the number of documents --- meilidb-core/src/store/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meilidb-core/src/store/main.rs b/meilidb-core/src/store/main.rs index eb1921b07..085609e4f 100644 --- a/meilidb-core/src/store/main.rs +++ b/meilidb-core/src/store/main.rs @@ -75,7 +75,7 @@ impl Main { Ok(new) } - pub fn number_of_documents(&self, reader: &zlmdb::RwTxn) -> ZResult { + pub fn number_of_documents(&self, reader: &zlmdb::RoTxn) -> ZResult { match self.main.get::>(reader, NUMBER_OF_DOCUMENTS_KEY)? { Some(value) => Ok(value), None => Ok(0),