🐛 Bug: 添加 HTTP 客户端会话上下文检查 (#2632)

This commit is contained in:
Ju4tCode
2024-04-08 20:17:03 +08:00
committed by GitHub
parent 7a232c7a4a
commit 9b4b1526b1
3 changed files with 9 additions and 0 deletions

View File

@ -93,6 +93,8 @@ class Session(HTTPClientSession):
@override
async def setup(self) -> None:
if self._client is not None:
raise RuntimeError("Session has already been initialized")
self._client = httpx.AsyncClient(
params=self._params,
headers=self._headers,