mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-29 06:33:28 +00:00
fix(prometheus): return early on team lookup failure instead of rebinding team_info
This commit is contained in:
parent
578521d119
commit
32026a6272
1 changed files with 7 additions and 2 deletions
|
|
@ -4230,15 +4230,20 @@ class PrometheusLogger(CustomLogger):
|
|||
max_budget=max_budget if max_budget is not None else carried.max_budget,
|
||||
budget_reset_at=carried.budget_reset_at,
|
||||
)
|
||||
team_info: LiteLLM_TeamTable | None = None
|
||||
try:
|
||||
team_info = await get_team_object(
|
||||
team_info: Final = await get_team_object(
|
||||
team_id=team_id,
|
||||
prisma_client=prisma_client,
|
||||
user_api_key_cache=user_api_key_cache,
|
||||
)
|
||||
except Exception as e:
|
||||
verbose_logger.debug("[Non-Blocking] Prometheus: Error getting team info: %s", e)
|
||||
return LiteLLM_TeamTable(
|
||||
team_id=team_id,
|
||||
team_alias=team_alias,
|
||||
spend=_total_team_spend,
|
||||
max_budget=max_budget,
|
||||
)
|
||||
|
||||
# metadata spend of None means "unknown", not "nothing spent" -- fall back to the DB value
|
||||
_base_spend: Final = (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue