(feat) better debugging for /cache/ping

This commit is contained in:
Ishaan Jaff 2024-03-20 08:30:11 -07:00
parent 2256ece5a9
commit 4ed551dc52

View file

@ -7571,13 +7571,14 @@ async def cache_ping():
Endpoint for checking if cache can be pinged Endpoint for checking if cache can be pinged
""" """
try: try:
litellm_cache_params = {}
specific_cache_params = {}
if litellm.cache is None: if litellm.cache is None:
raise HTTPException( raise HTTPException(
status_code=503, detail="Cache not initialized. litellm.cache is None" status_code=503, detail="Cache not initialized. litellm.cache is None"
) )
litellm_cache_params = {}
specific_cache_params = {}
for k, v in vars(litellm.cache).items(): for k, v in vars(litellm.cache).items():
try: try:
if k == "cache": if k == "cache":
@ -7618,7 +7619,6 @@ async def cache_ping():
"cache_type": litellm.cache.type, "cache_type": litellm.cache.type,
"litellm_cache_params": litellm_cache_params, "litellm_cache_params": litellm_cache_params,
} }
return None
except Exception as e: except Exception as e:
raise HTTPException( raise HTTPException(
status_code=503, status_code=503,