telephony: wake for the next announce instead of waiting on the idle tick

This commit is contained in:
DeFiDude committed 2026-11-08 06:29:14 -07:00
1 parent b6d7d921f5
commit dff93e73af
1 file changed
+12
+12
View File
@@ -1298,6 +1298,8 @@ impl TelephonyService {
period = wanted;
interval = tokio::time::interval(period);
}
// Announces keep their own deadline; the idle tick would quantize them to a second.
let next_announce_at = self.next_announce_at;
tokio::select! {
progressed = self.endpoint.manager.step(), if manager_open => {
manager_open = progressed;
@@ -1305,6 +1307,16 @@ impl TelephonyService {
break;
}
}
_ = async {
match next_announce_at {
Some(at) => tokio::time::sleep_until(at).await,
None => std::future::pending().await,
}
} => {
if !self.handle_due_announce().await {
break;
}
}
control = self.control_rx.recv() => {
let Some(control) = control else {
break;