forked from phoenix/litellm-mirror
fix(auth_checks.py): handle writing team object to redis caching correctly
This commit is contained in:
parent
21eea28723
commit
92b539b42a
2 changed files with 7 additions and 2 deletions
|
@ -3,3 +3,7 @@ model_list:
|
||||||
litellm_params:
|
litellm_params:
|
||||||
model: "*"
|
model: "*"
|
||||||
|
|
||||||
|
litellm_settings:
|
||||||
|
cache: true
|
||||||
|
cache_params:
|
||||||
|
type: redis
|
|
@ -373,12 +373,13 @@ async def _cache_team_object(
|
||||||
proxy_logging_obj: Optional[ProxyLogging],
|
proxy_logging_obj: Optional[ProxyLogging],
|
||||||
):
|
):
|
||||||
key = "team_id:{}".format(team_id)
|
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 ##
|
## UPDATE REDIS CACHE ##
|
||||||
if proxy_logging_obj is not None:
|
if proxy_logging_obj is not None:
|
||||||
await proxy_logging_obj.internal_usage_cache.async_set_cache(
|
await proxy_logging_obj.internal_usage_cache.async_set_cache(
|
||||||
key=key, value=team_table
|
key=key, value=value
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue