Merge pull request #2524 from BerriAI/litellm_fix_update_user

(fix) - update user error
This commit is contained in:
Ishaan Jaff 2024-03-15 08:51:45 -07:00 committed by GitHub
commit 31dcc6acf2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1422,6 +1422,8 @@ async def update_cache(
try: try:
for _id in user_ids: for _id in user_ids:
# Fetch the existing cost for the given user # Fetch the existing cost for the given user
if _id is None:
continue
existing_spend_obj = await user_api_key_cache.async_get_cache(key=_id) existing_spend_obj = await user_api_key_cache.async_get_cache(key=_id)
if existing_spend_obj is None: if existing_spend_obj is None:
# if user does not exist in LiteLLM_UserTable, create a new user # if user does not exist in LiteLLM_UserTable, create a new user