Skip to content

Commit 8b7e34b

Browse files
committed
feat: add config to snapshot
> open_read_only_store_conn
1 parent 25b548c commit 8b7e34b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

cli/src/cli.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ impl Context{
289289
}
290290

291291
pub fn open_read_only_store_conn(&self) -> Result<TapeStore> {
292-
Ok(tape_network::store::read_only()?)
292+
let rocksdb_config = self.config.storage.rocksdb.as_ref()
293+
.ok_or_else(|| anyhow::anyhow!("RocksDB config not found"))?;
294+
Ok(tape_network::store::read_only(&rocksdb_config.primary_path)?)
293295
}
294296

295297

network/src/store/helpers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ pub fn secondary_web(tape_store_primary_db: &str, tape_store_secondary_db_web: &
2424
TapeStore::new_secondary(&db_primary, &db_secondary)
2525
}
2626

27-
pub fn read_only() -> Result<TapeStore, StoreError> {
27+
pub fn read_only(tape_store_primary_db: &str,) -> Result<TapeStore, StoreError> {
2828
let current_dir = env::current_dir().map_err(StoreError::IoError)?;
29-
let db_primary = current_dir.join(TAPE_STORE_PRIMARY_DB);
29+
let db_primary = current_dir.join(tape_store_primary_db);
3030
TapeStore::new_read_only(&db_primary)
3131
}
3232

0 commit comments

Comments
 (0)