(self, reservation_id: str, estimated_cost: float)
| 220 | return total |
| 221 | |
| 222 | async def reserve(self, reservation_id: str, estimated_cost: float): |
| 223 | async with self._lock: |
| 224 | pending_total = self._gc(time.time()) |
| 225 | result = self._spend.check(estimated_cost, additional_committed=pending_total) |
| 226 | if result.allowed: |
| 227 | self._pending[reservation_id] = (estimated_cost, time.time()) |
| 228 | return result |
| 229 | |
| 230 | async def update_reserve(self, reservation_id: str, estimated_cost: float): |
| 231 | """Re-reserve a request under a new estimated cost (e.g. fallback model).""" |
no test coverage detected