fix(observe): 保留 asyncio.TimeoutError 捕获(3.10 兼容,撤销 UP041 自动改写)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -28,7 +28,7 @@ async def _collect_batch() -> list[dict]:
|
||||
first = await asyncio.wait_for(
|
||||
queue.get(), timeout=settings.OBSERVE_FLUSH_INTERVAL_SEC
|
||||
)
|
||||
except TimeoutError:
|
||||
except asyncio.TimeoutError: # noqa: UP041 - 3.10 兼容:该版 wait_for 抛的 asyncio.TimeoutError ≠ 内置 TimeoutError
|
||||
return batch
|
||||
batch.append(first)
|
||||
while len(batch) < settings.OBSERVE_BATCH_MAX:
|
||||
|
||||
Reference in New Issue
Block a user