mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
(feat) show semantic-cache on health/readiness
This commit is contained in:
parent
3d1d447db9
commit
d9f407b4c2
2 changed files with 13 additions and 0 deletions
|
@ -4051,8 +4051,18 @@ async def health_readiness():
|
|||
|
||||
cache_type = None
|
||||
if litellm.cache is not None:
|
||||
from litellm.caching import RedisSemanticCache
|
||||
|
||||
cache_type = litellm.cache.type
|
||||
|
||||
if isinstance(litellm.cache.cache, RedisSemanticCache):
|
||||
# ping the cache
|
||||
try:
|
||||
index_info = await litellm.cache.cache._index_info()
|
||||
except Exception as e:
|
||||
index_info = "index does not exist - error: " + str(e)
|
||||
cache_type = {"type": cache_type, "index_info": index_info}
|
||||
|
||||
if prisma_client is not None: # if db passed in, check if it's connected
|
||||
await prisma_client.health_check() # test the db connection
|
||||
response_object = {"db": "connected"}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue