forked from phoenix/litellm-mirror
fix don't store bad api key in user api key cache
This commit is contained in:
parent
14da2d5ade
commit
0003de41c1
1 changed files with 2 additions and 2 deletions
|
@ -936,8 +936,8 @@ async def update_cache(
|
||||||
f"_update_key_cache: existing spend: {existing_spend_obj}"
|
f"_update_key_cache: existing spend: {existing_spend_obj}"
|
||||||
)
|
)
|
||||||
if existing_spend_obj is None:
|
if existing_spend_obj is None:
|
||||||
existing_spend = 0
|
# print("existing_spend_obj is None adding a bad value to use api key cache")
|
||||||
existing_spend_obj = LiteLLM_VerificationTokenView(token=token)
|
return
|
||||||
else:
|
else:
|
||||||
existing_spend = existing_spend_obj.spend
|
existing_spend = existing_spend_obj.spend
|
||||||
# Calculate the new cost by adding the existing cost and response_cost
|
# Calculate the new cost by adding the existing cost and response_cost
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue