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> {