mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-04 02:31:27 +00:00
Merge 07396cf07d into 85dc7cb62e
This commit is contained in:
commit
271eb8d48d
1 changed files with 5 additions and 4 deletions
|
|
@ -269,10 +269,11 @@ class InMemoryCache(BaseCache):
|
|||
self._remove_key(key)
|
||||
|
||||
async def async_get_ttl(self, key: str) -> int | None:
|
||||
"""
|
||||
Get the remaining TTL of a key in in-memory cache
|
||||
"""
|
||||
return self.ttl_dict.get(key, None)
|
||||
"""Get the remaining TTL of a key in in-memory cache"""
|
||||
expiry = self.ttl_dict.get(key, None)
|
||||
if expiry is None:
|
||||
return None
|
||||
return max(0, expiry - time.time())
|
||||
|
||||
async def async_get_oldest_n_keys(self, n: int) -> list[str]:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue