diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-08-14 23:12:46 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-08-14 23:12:46 +0200 |
commit | 56de00945fbad7a5f6c0363143223ea01e1d9126 (patch) | |
tree | 797c0945187cec5cb6a529cd3859e99ce4b54098 /src/db/lmdb_adapter.rs | |
parent | efc87a8b8e73c422995f70ad0851c41b55d8de6f (diff) | |
download | garage-56de00945fbad7a5f6c0363143223ea01e1d9126.tar.gz garage-56de00945fbad7a5f6c0363143223ea01e1d9126.zip |
proxy finalized, use it by setting 'lmdb-with-metrics'
Diffstat (limited to 'src/db/lmdb_adapter.rs')
-rw-r--r-- | src/db/lmdb_adapter.rs | 11 |
1 files changed, 7 insertions, 4 deletions
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<Database> { |