Skip to content

Commit

Permalink
feat(config): implement configurable update interval (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
sardylan authored Sep 11, 2024
1 parent 32db4bb commit 60df932
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub struct Config {
short = 'i',
long,
action = ArgAction::Set,
default_value = "1000",
default_value = "2000",
help = "Update interval",
long_help = "Set the duration of the interval between two updates (milliseconds)"
)]
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ use crate::config::Config;
use crate::errors::WavelogHamlibError;
use crate::wavelog::Update;
use clap::Parser;
use hamlib_client::adif::Mode;
use hamlib_client::RigCtlClient;
use std::time::Duration;
use hamlib_client::adif::Mode;
use tokio::time::sleep;

#[tokio::main]
Expand Down Expand Up @@ -104,6 +104,6 @@ async fn program(configuration: &Config) -> Result<(), WavelogHamlibError> {
}

log::debug!("Sleeping");
sleep(Duration::from_millis(1000)).await;
sleep(Duration::from_millis(configuration.interval)).await;
}
}

0 comments on commit 60df932

Please sign in to comment.