File tree Expand file tree Collapse file tree 3 files changed +10
-12
lines changed
Expand file tree Collapse file tree 3 files changed +10
-12
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ pub struct SampleService {
5454}
5555pub 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 ( ) ;
Original file line number Diff line number Diff 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 ( ) ;
You can’t perform that action at this time.
0 commit comments