Skip to content

Commit 73d51d6

Browse files
committed
feat: add config for web
1 parent b875f87 commit 73d51d6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

cli/src/cli.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,9 @@ impl Context{
281281
}
282282

283283
pub fn open_secondary_store_conn_web(&self) -> Result<TapeStore> {
284-
Ok(tape_network::store::secondary_web()?)
284+
let rocksdb_config = self.config.storage.rocksdb.as_ref()
285+
.ok_or_else(|| anyhow::anyhow!("RocksDB config not found"))?;
286+
Ok(tape_network::store::secondary_web(&rocksdb_config.primary_path, &rocksdb_config.secondary_path_web)?)
285287
}
286288

287289
pub fn open_read_only_store_conn(&self) -> Result<TapeStore> {

network/src/store/helpers.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ pub fn secondary_mine(tape_store_primary_db: &str, tape_store_secondary_db_mine:
1616
TapeStore::new_secondary(&db_primary, &db_secondary)
1717
}
1818

19-
pub fn secondary_web() -> Result<TapeStore, StoreError> {
19+
pub fn secondary_web(tape_store_primary_db: &str, tape_store_secondary_db_web: &str) -> Result<TapeStore, StoreError> {
2020
let current_dir = env::current_dir().map_err(StoreError::IoError)?;
21-
let db_primary = current_dir.join(TAPE_STORE_PRIMARY_DB);
22-
let db_secondary = current_dir.join(TAPE_STORE_SECONDARY_DB_WEB);
21+
let db_primary = current_dir.join(tape_store_primary_db);
22+
let db_secondary = current_dir.join(tape_store_secondary_db_web);
2323
std::fs::create_dir_all(&db_secondary).map_err(StoreError::IoError)?;
2424
TapeStore::new_secondary(&db_primary, &db_secondary)
2525
}

0 commit comments

Comments
 (0)