Skip to content

Commit 8aec80e

Browse files
committed
make shred path required
1 parent 9b13882 commit 8aec80e

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

tinydancer/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ async fn main() -> Result<()> {
151151
tui_monitor,
152152
log_path: config_file.log_path,
153153
archive_config: {
154-
archive_path.map(|path| ArchiveConfig {
154+
archive_path.map(|path| Ok(ArchiveConfig {
155155
shred_archive_duration,
156156
archive_path: path,
157-
})
157+
})).unwrap_or(Err(anyhow!("shred path not provided...")))?
158158
},
159159
};
160160

tinydancer/src/sampler.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub struct SampleService {
5454
}
5555
pub struct SampleServiceConfig {
5656
pub cluster: Cluster,
57-
pub archive_config: Option<ArchiveConfig>,
57+
pub archive_config: ArchiveConfig,
5858
pub instance: Arc<rocksdb::DB>,
5959
pub status_sampler: Arc<Mutex<ClientStatus>>,
6060
}
@@ -101,13 +101,11 @@ impl ClientService<SampleServiceConfig> for SampleService {
101101
// verify shreds + store in db in shred_archiver
102102
threads.push(tokio::spawn(shred_verify_loop(shred_rx, verified_shred_tx)));
103103

104-
if let Some(archive_config) = config.archive_config {
105-
threads.push(tokio::spawn(shred_archiver(
106-
verified_shred_rx,
107-
archive_config,
108-
config.instance,
109-
)));
110-
}
104+
threads.push(tokio::spawn(shred_archiver(
105+
verified_shred_rx,
106+
config.archive_config,
107+
config.instance,
108+
)));
111109

112110
for thread in threads {
113111
thread.await.unwrap().unwrap();

tinydancer/src/tinydancer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub struct TinyDancerConfig {
4646
pub rpc_endpoint: Cluster,
4747
pub sample_qty: u64,
4848
pub enable_ui_service: bool,
49-
pub archive_config: Option<ArchiveConfig>,
49+
pub archive_config: ArchiveConfig,
5050
pub tui_monitor: bool,
5151
pub log_path: String,
5252
}
@@ -104,7 +104,7 @@ impl TinyDancer {
104104
// setup db
105105
let db = rocksdb::DB::open_cf(
106106
&opts,
107-
archive_config.clone().unwrap().archive_path,
107+
archive_config.clone().archive_path,
108108
vec![SHRED_CF],
109109
)
110110
.unwrap();

0 commit comments

Comments
 (0)