Skip to content

Commit

Permalink
Remove need for settings file to dump file (#919)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldjeffrey authored Dec 17, 2024
1 parent 6a8bb9b commit 4f21e29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions file_store/src/cli/dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
unique_connections::UniqueConnectionReq,
usage_counts::{HexUsageCountsIngestReport, RadioUsageCountsIngestReport},
wifi_heartbeat::WifiHeartbeatIngestReport,
FileType, Result, Settings,
FileType, Result,
};
use base64::Engine;
use csv::Writer;
Expand Down Expand Up @@ -54,7 +54,7 @@ pub struct Cmd {
}

impl Cmd {
pub async fn run(&self, _settings: &Settings) -> Result {
pub async fn run(&self) -> Result {
let mut file_stream = file_source::source([&self.in_path]);

let mut wtr = Writer::from_writer(io::stdout());
Expand Down Expand Up @@ -301,6 +301,7 @@ impl Cmd {
"written_files": manifest.written_files,
"start_timestamp": manifest.start_timestamp,
"end_timestamp": manifest.end_timestamp,
"reward_data": manifest.reward_data.unwrap()
}))?;
}
FileType::SignedPocReceiptTxn => {
Expand Down
12 changes: 6 additions & 6 deletions file_store/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct Cli {

impl Cli {
pub async fn run(self) -> Result {
let settings = Settings::new(&self.config)?;
let settings = Settings::new(&self.config);
self.cmd.run(settings).await
}
}
Expand All @@ -33,12 +33,12 @@ pub enum Cmd {
}

impl Cmd {
pub async fn run(&self, settings: Settings) -> Result {
pub async fn run(&self, settings: Result<Settings>) -> Result {
match self {
Cmd::Info(cmd) => cmd.run(&settings).await,
Cmd::Dump(cmd) => cmd.run(&settings).await,
Cmd::Bucket(cmd) => cmd.run(&settings).await,
Cmd::DumpMobileRewards(cmd) => cmd.run(&settings).await,
Cmd::Info(cmd) => cmd.run(&settings?).await,
Cmd::Dump(cmd) => cmd.run().await,
Cmd::Bucket(cmd) => cmd.run(&settings?).await,
Cmd::DumpMobileRewards(cmd) => cmd.run(&settings?).await,
}
}
}
Expand Down

0 comments on commit 4f21e29

Please sign in to comment.