mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
fix(caching.py): fix redis caching ping check
don't fail to startup. Log an error message.
This commit is contained in:
parent
27eec16f32
commit
da4991de05
1 changed files with 10 additions and 3 deletions
|
@ -177,11 +177,18 @@ class RedisCache(BaseCache):
|
||||||
try:
|
try:
|
||||||
# asyncio.get_running_loop().create_task(self.ping())
|
# asyncio.get_running_loop().create_task(self.ping())
|
||||||
result = asyncio.get_running_loop().create_task(self.ping())
|
result = asyncio.get_running_loop().create_task(self.ping())
|
||||||
except Exception:
|
except Exception as e:
|
||||||
pass
|
verbose_logger.error(
|
||||||
|
"Error connecting to Async Redis client", extra={"error": str(e)}
|
||||||
|
)
|
||||||
|
|
||||||
### SYNC HEALTH PING ###
|
### SYNC HEALTH PING ###
|
||||||
self.redis_client.ping()
|
try:
|
||||||
|
self.redis_client.ping()
|
||||||
|
except Exception as e:
|
||||||
|
verbose_logger.error(
|
||||||
|
"Error connecting to Sync Redis client", extra={"error": str(e)}
|
||||||
|
)
|
||||||
|
|
||||||
def init_async_client(self):
|
def init_async_client(self):
|
||||||
from ._redis import get_redis_async_client
|
from ._redis import get_redis_async_client
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue