mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
Update litellm/proxy/utils.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
parent
f33a7ca7d6
commit
d90f3d558e
1 changed files with 2 additions and 5 deletions
|
|
@ -2075,11 +2075,8 @@ async def _lookup_deprecated_key(
|
|||
now_ts + _DEPRECATED_KEY_CACHE_TTL_SECONDS,
|
||||
)
|
||||
return deprecated_row.active_token_id
|
||||
# Cache negative result to avoid repeated DB lookups for invalid tokens
|
||||
_deprecated_key_cache[hashed_token] = (
|
||||
None,
|
||||
now_ts + _DEPRECATED_KEY_CACHE_TTL_SECONDS,
|
||||
)
|
||||
# Only cache positive results; negative lookups are fast on indexed columns
|
||||
# and caching them risks evicting real deprecated key entries.
|
||||
except Exception as e:
|
||||
verbose_proxy_logger.debug("Deprecated key lookup skipped: %s", e)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue