tracing and changes

This commit is contained in:
2026-09-13 16:25:47 +01:00
parent 74f59be3f8
commit 57201bc0ff
17 changed files with 306 additions and 47 deletions
+3
View File
@@ -39,12 +39,15 @@ impl ClockTicker {
iced::stream::channel(0, move |mut sender: mpsc::Sender<Wire>| async move {
let mut clock = ClockTicker::new();
let mut interval = tokio::time::interval(std::time::Duration::from_secs(1));
tracing::info!(key, "clock service started");
loop {
tokio::select! {
_ = interval.tick() => {
if let Some(payload) = clock.tick() {
tracing::debug!(key, kind = ?payload.kind, "publishing clock");
let wire = Wire::topic(Endpoint::service(key), key, payload);
if sender.send(wire).await.is_err() {
tracing::warn!(key, "clock send failed; stopping service");
return;
}
}