From 2c654bd7dd34ca922ba255d7f372073ecbcbbb38 Mon Sep 17 00:00:00 2001 From: Harshit Jain <48647625+Harshit28j@users.noreply.github.com> Date: Sun, 15 Feb 2026 08:05:44 +0530 Subject: [PATCH] Update litellm/proxy/utils.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- litellm/proxy/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index f7e32869a23..bb95b98da66 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -2054,9 +2054,10 @@ async def _lookup_deprecated_key( # Check cache first cached = _deprecated_key_cache.get(hashed_token) + cached = _deprecated_key_cache.get(hashed_token) if cached is not None: - active_token_id, cache_expires_at_ts = cached - if now_ts < cache_expires_at_ts: + active_token_id, cache_expires_at_ts, revoke_at_ts = cached + if now_ts < cache_expires_at_ts and now_ts < revoke_at_ts: return active_token_id else: _deprecated_key_cache.pop(hashed_token, None)