improve parsing of durations
This commit is contained in:
@@ -162,7 +162,7 @@ impl ChronyClient {
|
||||
.expect("Unable to parse host:port:");
|
||||
let client_options = ClientOptions {
|
||||
n_tries: 3,
|
||||
timeout: Duration::from_secs(config.sources.chrony.timeout),
|
||||
timeout: config.sources.chrony.timeout,
|
||||
};
|
||||
ChronyClient {
|
||||
server,
|
||||
@@ -298,12 +298,8 @@ impl ChimemonSource for ChronyClient {
|
||||
async fn run(self, chan: ChimemonSourceChannel) {
|
||||
info!("Chrony task started");
|
||||
|
||||
let mut t_interval = tokio::time::interval(Duration::from_secs(
|
||||
self.config.sources.chrony.tracking_interval,
|
||||
));
|
||||
let mut s_interval = tokio::time::interval(Duration::from_secs(
|
||||
self.config.sources.chrony.sources_interval,
|
||||
));
|
||||
let mut t_interval = tokio::time::interval(self.config.sources.chrony.tracking_interval);
|
||||
let mut s_interval = tokio::time::interval(self.config.sources.chrony.sources_interval);
|
||||
|
||||
let t_future = async {
|
||||
let lchan = chan.clone();
|
||||
|
||||
Reference in New Issue
Block a user