git.lucas.co / cce-authenticator
login authentication (PAM + fingerprint)
git clone https://git.lucas.co/cce-authenticator.git

commit3a5ace93c42f463a798370adde67374a34f99bbd
parent516679dc22
authorLucas Galante <[email protected]>
date2026-09-11 10:16
idle_poll_interval: tick polls a channel the runner cannot see

cce-ui@d5b22a5 sleeps between ticks while idle; this app drains its own
std channels in tick, so it bounds that sleep rather than waiting for an
unrelated event.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

 src/main.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/main.rs b/src/main.rs
index 9727766..b18c258 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -627,6 +627,12 @@ impl Application for AuthenticatorApp {
         }
     }
 
+    /// `tick` drains `rx_auth`, a std channel the runner cannot see; without
+    /// this the password verdict would wait for the next unrelated event.
+    fn idle_poll_interval(&self) -> Option<std::time::Duration> {
+        Some(std::time::Duration::from_millis(50))
+    }
+
     fn tick(&mut self, dt: f32, needs_rebuild: &mut bool) {
         while let Ok(res) = self.rx_auth.try_recv() {
             let _ = self.sender.send(AppMessage::AuthDone(res));