mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
simplify prefetch_rate_limits
This commit is contained in:
@@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user