Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/saic_ismart_client_ng/api/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def __init__(
self.__api_client = SaicApiClient(configuration, listener=listener)
self.__token_expiration: datetime.datetime | None = None

async def close(self) -> None:
"""Close the API client and release its HTTP resources."""
await self.__api_client.close()

async def login(self) -> LoginResp:
headers = {
"Content-Type": "application/x-www-form-urlencoded",
Expand Down
4 changes: 4 additions & 0 deletions src/saic_ismart_client_ng/net/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ def __init__(
async def send(self, request: Request) -> Response:
return await self.__client.send(request)

async def close(self) -> None:
"""Close the underlying HTTP client and release its connections."""
await self.__client.aclose()

@property
def user_token(self) -> str:
return self.__user_token
Expand Down