use shared constant for message interval

This commit is contained in:
csehviktor
2025-07-06 02:27:39 +02:00
parent d6c82af613
commit 158369ffb3
2 changed files with 3 additions and 4 deletions

View File

@@ -1,3 +1,4 @@
use common::MQTT_SEND_INTERVAL;
use collector::Collector;
use std::time::Duration;
use mqtt::MqttHandle;
@@ -19,9 +20,6 @@ struct Args {
#[arg(long, default_value_t = 1883)]
port: u16,
#[arg(long, short='i', default_value_t = 5)]
interval: u64,
}
#[tokio::main]
@@ -37,6 +35,6 @@ async fn main() -> anyhow::Result<()> {
let metrics = collector.collect_all();
client.send_metrics(metrics).await?;
thread::sleep(Duration::from_secs(args.interval));
thread::sleep(Duration::from_secs(MQTT_SEND_INTERVAL));
}
}