From 82f49f4b4e0f708d4434d8209f5b1317a00d2811 Mon Sep 17 00:00:00 2001 From: kevin zhao Date: Mon, 17 Nov 2025 13:23:05 -0800 Subject: [PATCH] simplify prefetch_rate_limits --- codex-rs/tui/src/chatwidget.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs index ea6437ba46..5d6a5fa105 100644 --- a/codex-rs/tui/src/chatwidget.rs +++ b/codex-rs/tui/src/chatwidget.rs @@ -1763,15 +1763,11 @@ impl ChatWidget { tokio::spawn(async move { let mut interval = tokio::time::interval(Duration::from_secs(60)); - if let Some(snapshot) = fetch_rate_limits(base_url.clone(), auth.clone()).await { - app_event_tx.send(AppEvent::RateLimitSnapshotFetched(snapshot)); - } - loop { - interval.tick().await; if let Some(snapshot) = fetch_rate_limits(base_url.clone(), auth.clone()).await { app_event_tx.send(AppEvent::RateLimitSnapshotFetched(snapshot)); } + interval.tick().await; } }); }