fix(lint): resolve remaining ruff errors and unblock MCP SSE test (#1)
This commit is contained in:
parent
a7c30b12cd
commit
98eebe62bf
17 changed files with 60 additions and 87 deletions
|
|
@ -73,10 +73,8 @@ class PryAutomator:
|
|||
"""Periodically clean up stale sessions to prevent memory leaks."""
|
||||
while True:
|
||||
await asyncio.sleep(SESSION_CLEANUP_INTERVAL)
|
||||
try:
|
||||
with contextlib.suppress(Exception):
|
||||
await self._cleanup_stale_sessions()
|
||||
except Exception: # noqa: BLE001
|
||||
pass
|
||||
|
||||
async def _get_or_create_session(
|
||||
self, session_id: str | None = None, headless: bool = True, viewport: dict | None = None
|
||||
|
|
@ -281,10 +279,8 @@ class PryAutomator:
|
|||
) -> str:
|
||||
session = await self._get_or_create_session()
|
||||
if cookies:
|
||||
try:
|
||||
with contextlib.suppress(Exception):
|
||||
await session.context.add_cookies(cookies)
|
||||
except Exception: # noqa: BLE001
|
||||
pass
|
||||
await session.page.goto(url, wait_until="networkidle")
|
||||
return session.id
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue