From aabf7512b4bfd7086b9f70c0cafd92e3f5dc305c Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Mon, 6 Jan 2025 16:22:21 +0100 Subject: [PATCH] Fix browser closing --- skyvern/webeye/browser_factory.py | 4 ---- skyvern/webeye/persistent_sessions_manager.py | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/skyvern/webeye/browser_factory.py b/skyvern/webeye/browser_factory.py index 15a1a34ff..dbccaf50a 100644 --- a/skyvern/webeye/browser_factory.py +++ b/skyvern/webeye/browser_factory.py @@ -1,7 +1,6 @@ from __future__ import annotations import asyncio -import json import os import time import uuid @@ -190,9 +189,6 @@ def build_browser_args(proxy_location: ProxyLocation | None = None, **kwargs: di if kwargs.get("cdp_port"): args["args"].append(f"--remote-debugging-port={kwargs.get('cdp_port')}") - # pretty print args - print(json.dumps(args, indent=2)) - if proxy_location: if tz_info := get_tzinfo_from_proxy(proxy_location=proxy_location): args["timezone_id"] = tz_info.key diff --git a/skyvern/webeye/persistent_sessions_manager.py b/skyvern/webeye/persistent_sessions_manager.py index 4fd02bb18..68c828571 100644 --- a/skyvern/webeye/persistent_sessions_manager.py +++ b/skyvern/webeye/persistent_sessions_manager.py @@ -152,8 +152,8 @@ async def close_session(self, organization_id: str, session_id: str) -> None: organization_id=organization_id, session_id=session_id, ) - await browser_session.browser_state.close() self._browser_sessions.pop(session_id, None) + await browser_session.browser_state.close() else: LOG.info( "Browser session not found in memory, marking as deleted in database",