fix(redis.py): fix instantiating redis client from url

This commit is contained in:
Krrish Dholakia 2024-02-15 17:48:00 -08:00
parent 292a8321b6
commit fe9180a39d
2 changed files with 10 additions and 2 deletions

View file

@ -134,10 +134,12 @@ class RedisCache(BaseCache):
f"Set ASYNC Redis Cache: key: {key}\nValue {value}\nttl={ttl}"
)
try:
await redis_client.set(name=key, value=json.dumps(value), ex=ttl)
await redis_client.set(
name=key, value=json.dumps(value), ex=ttl, get=True
)
except Exception as e:
# NON blocking - notify users Redis is throwing an exception
logging.debug("LiteLLM Caching: set() - Got exception from REDIS : ", e)
print_verbose("LiteLLM Caching: set() - Got exception from REDIS : ", e)
async def async_set_cache_pipeline(self, cache_list, ttl=None):
"""