MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / open

Method open

nodedb/src/control/array_sync/ack_registry.rs:81–93  ·  view source on GitHub ↗

Open or create the ack registry database at `{data_dir}/array_sync/acks.redb`.

(data_dir: &Path)

Source from the content-addressed store, hash-verified

79impl ArrayAckRegistry {
80 /// Open or create the ack registry database at `{data_dir}/array_sync/acks.redb`.
81 pub fn open(data_dir: &Path) -> crate::Result<Arc<Self>> {
82 let dir = data_dir.join("array_sync");
83 std::fs::create_dir_all(&dir).map_err(|e| crate::Error::Storage {
84 engine: "array_sync".into(),
85 detail: format!("create dir {}: {e}", dir.display()),
86 })?;
87 let path = dir.join("acks.redb");
88 let db = Database::create(&path).map_err(|e| crate::Error::Storage {
89 engine: "array_sync".into(),
90 detail: format!("open acks db {}: {e}", path.display()),
91 })?;
92 Self::init_db(db)
93 }
94
95 /// In-memory-only registry for tests.
96 pub fn open_in_memory() -> crate::Result<Arc<Self>> {

Callers

nothing calls this directly

Calls 2

joinMethod · 0.80
createFunction · 0.50

Tested by

no test coverage detected