From 56de00945fbad7a5f6c0363143223ea01e1d9126 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 14 Aug 2024 23:12:46 +0200 Subject: proxy finalized, use it by setting 'lmdb-with-metrics' --- src/db/lmdb_adapter.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/db/lmdb_adapter.rs') diff --git a/src/db/lmdb_adapter.rs b/src/db/lmdb_adapter.rs index ecfe5e1e..a8fa15e8 100644 --- a/src/db/lmdb_adapter.rs +++ b/src/db/lmdb_adapter.rs @@ -39,12 +39,15 @@ pub struct LmdbDb { } impl LmdbDb { - pub fn init(db: Env) -> Db { - let s = Self { + pub fn to_wrap(db: Env) -> Self { + Self { db, trees: RwLock::new((Vec::new(), HashMap::new())), - }; - Db(Arc::new(s)) + } + } + + pub fn init(db: Env) -> Db { + Db(Arc::new(Self::to_wrap(db))) } fn get_tree(&self, i: usize) -> Result { -- cgit v1.2.3