fix(lint): resolve remaining ruff errors and unblock MCP SSE test (#1)
Some checks failed
CI / lint (push) Failing after 2s
CI / typecheck (push) Failing after 1s
CI / test (push) Failing after 1s
CI / Secret scan (gitleaks) (push) Failing after 2s
CI / Security audit (bandit) (push) Failing after 2s

This commit is contained in:
Crypto Rug Munch 2026-07-02 23:18:40 +02:00
parent a7c30b12cd
commit 98eebe62bf
17 changed files with 60 additions and 87 deletions

View file

@ -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