From 36ef9581aa313990e013b2a4a323dc4de019e2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Sat, 29 Dec 2018 21:07:01 +0100 Subject: [PATCH] feat: Return the database view for each update --- src/database/database.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/database/database.rs b/src/database/database.rs index 70e3664a3..507f9436b 100644 --- a/src/database/database.rs +++ b/src/database/database.rs @@ -74,7 +74,7 @@ impl Database { Ok(Database { db: Mutex::new(db), view }) } - pub fn ingest_update_file(&self, update: Update) -> Result<(), Box> { + pub fn ingest_update_file(&self, update: Update) -> Result>>, Box> { let snapshot = { // We must have a mutex here to ensure that update ingestions and compactions // are done atomatically and in the right order. @@ -103,9 +103,9 @@ impl Database { }; let view = Arc::new(DatabaseView::new(snapshot)?); - self.view.set(view); + self.view.set(view.clone()); - Ok(()) + Ok(view) } pub fn get(&self, key: &[u8]) -> Result, Box> {