mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-05 08:07:05 +00:00
finalize invalidated budget reservations
This commit is contained in:
parent
e034935b53
commit
f8d187785d
2 changed files with 2 additions and 0 deletions
|
|
@ -489,6 +489,7 @@ async def _update_database_and_spend_counters(
|
|||
await _invalidate_budget_reservation_counters(
|
||||
budget_reservation=budget_reservation
|
||||
)
|
||||
budget_reservation["finalized"] = True
|
||||
except Exception:
|
||||
verbose_proxy_logger.exception(
|
||||
"Failed to invalidate budget reservation counters after spend counter update failed"
|
||||
|
|
|
|||
|
|
@ -450,6 +450,7 @@ async def test_update_database_and_spend_counters_invalidates_reservation_when_c
|
|||
mock_invalidate_budget_reservation_counters.assert_awaited_once_with(
|
||||
budget_reservation=budget_reservation,
|
||||
)
|
||||
assert budget_reservation["finalized"] is True
|
||||
|
||||
proxy_logging_obj.db_spend_update_writer.update_database.assert_awaited_once()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue