fix(auth_checks.py): handle writing team object to redis caching correctly

This commit is contained in:
Krrish Dholakia 2024-07-29 07:51:44 -07:00
parent 21eea28723
commit 92b539b42a
2 changed files with 7 additions and 2 deletions

View file

@ -3,3 +3,7 @@ model_list:
litellm_params:
model: "*"
litellm_settings:
cache: true
cache_params:
type: redis

View file

@ -373,12 +373,13 @@ async def _cache_team_object(
proxy_logging_obj: Optional[ProxyLogging],
):
key = "team_id:{}".format(team_id)
await user_api_key_cache.async_set_cache(key=key, value=team_table)
value = team_table.model_dump_json(exclude_unset=True)
await user_api_key_cache.async_set_cache(key=key, value=value)
## UPDATE REDIS CACHE ##
if proxy_logging_obj is not None:
await proxy_logging_obj.internal_usage_cache.async_set_cache(
key=key, value=team_table
key=key, value=value
)