Skip to content

Commit 60df932

Browse files
authored
feat(config): implement configurable update interval (#4)
1 parent 32db4bb commit 60df932

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub struct Config {
3636
short = 'i',
3737
long,
3838
action = ArgAction::Set,
39-
default_value = "1000",
39+
default_value = "2000",
4040
help = "Update interval",
4141
long_help = "Set the duration of the interval between two updates (milliseconds)"
4242
)]

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ use crate::config::Config;
2323
use crate::errors::WavelogHamlibError;
2424
use crate::wavelog::Update;
2525
use clap::Parser;
26+
use hamlib_client::adif::Mode;
2627
use hamlib_client::RigCtlClient;
2728
use std::time::Duration;
28-
use hamlib_client::adif::Mode;
2929
use tokio::time::sleep;
3030

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

106106
log::debug!("Sleeping");
107-
sleep(Duration::from_millis(1000)).await;
107+
sleep(Duration::from_millis(configuration.interval)).await;
108108
}
109109
}

0 commit comments

Comments
 (0)