refactor config

This commit is contained in:
2026-02-04 14:25:17 -08:00
parent d31bf8d39e
commit 50894fd0e1
10 changed files with 333 additions and 369 deletions
+5 -6
View File
@@ -5,14 +5,13 @@ use async_trait::async_trait;
use chrony_candm::reply::{self, ReplyBody, SourceMode};
use chrony_candm::request::{self, RequestBody};
use chrony_candm::{ClientOptions, blocking_query};
use futures::future::join;
use tokio::{join, select};
use tokio::select;
use tokio_util::sync::CancellationToken;
use tracing::{info, warn};
use crate::{
ChimemonSource, ChimemonSourceChannel, ChronyConfig, MetricTags, SourceMetric, SourceReport,
SourceReportDetails, SourceStatus,
ChimemonSource, ChimemonSourceChannel, MetricTags, SourceMetric, SourceReport,
SourceReportDetails, SourceStatus, config::ChronyConfig,
};
pub struct ChronyClient {
@@ -313,7 +312,7 @@ impl ChimemonSource for ChronyClient {
match self.tracking_poll(&chan).await {
Ok(_) => (),
Err(e) => {
warn!("Error in chrony task: {}", e.to_string());
warn!(error = ?e, "Error in chrony tracking task");
}
}
},
@@ -321,7 +320,7 @@ impl ChimemonSource for ChronyClient {
match self.sources_poll(&chan).await {
Ok(_) => (),
Err(e) => {
warn!("Error in chrony task: {}", e.to_string());
warn!(error = ?e, "Error in chrony sources task");
}
}
}