mirror of
https://github.com/ratspeak/rsLXST
synced 2026-11-22 23:10:37 +00:00
telephony: wake for the next announce instead of waiting on the idle tick
This commit is contained in:
1 parent
b6d7d921f5
commit
dff93e73af
1 file changed
+12
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user