front: fix SyntaxError in _counting_iter (bare try without except/finally)

The previous commit (be9950a5) left a try: with no except/finally in the SSE
throughput counter, breaking import of the front. Remove the stray try (the
BackgroundTask _release already closes the upstream response).
Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
parent be9950a5
...@@ -724,9 +724,7 @@ class FrontProxy: ...@@ -724,9 +724,7 @@ class FrontProxy:
async def _counting_iter(): async def _counting_iter():
import time as _t import time as _t
t0 = _t.monotonic(); ntok = 0; last = 0.0 t0 = _t.monotonic(); ntok = 0; last = 0.0
try:
async for raw in rp_resp.aiter_raw(): async for raw in rp_resp.aiter_raw():
if _meas:
ntok += raw.count(b"data:") ntok += raw.count(b"data:")
now = _t.monotonic() now = _t.monotonic()
if now - last >= 0.5: # refresh ~2×/s, keep it cheap if now - last >= 0.5: # refresh ~2×/s, keep it cheap
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment