mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Renew cache ttl on etag match (#9174)
so we don't do unnecessary fetches
This commit is contained in:
committed by
GitHub
Unverified
parent
c96c26cf5b
commit
4d787a2cc2
@@ -156,6 +156,9 @@ impl ModelsManager {
|
||||
pub(crate) async fn refresh_if_new_etag(&self, etag: String, config: &Config) {
|
||||
let current_etag = self.get_etag().await;
|
||||
if current_etag.clone().is_some() && current_etag.as_deref() == Some(etag.as_str()) {
|
||||
if let Err(err) = self.cache_manager.renew_cache_ttl().await {
|
||||
error!("failed to renew cache TTL: {err}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if let Err(err) = self
|
||||
|
||||
Reference in New Issue
Block a user