Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
rad: Add ready-only db handle for notification store
Sebastian Martinez committed 2 years ago
commit 9b1f47d1b74178b8278a0feb379f20ccac185327
parent fbe33340edb3e341ae8ed6209e0068c055d1981b
1 file changed +8 -0
modified radicle/src/profile.rs
@@ -453,6 +453,14 @@ impl Home {
            .unwrap_or_else(|| self.node().join(node::DEFAULT_SOCKET_NAME))
    }

+
    /// Return a handle to a ready-only database of the notifications database.
+
    pub fn notifications(&self) -> Result<notifications::StoreReader, notifications::store::Error> {
+
        let path = self.node().join(node::NOTIFICATIONS_DB_FILE);
+
        let db = notifications::Store::reader(path)?;
+

+
        Ok(db)
+
    }
+

    /// Return a read-write handle to the notifications database.
    pub fn notifications_mut(
        &self,