potential ram fix
Build and Push Docker Images / build-and-push (push) Successful in 22s

This commit is contained in:
2025-07-04 15:21:40 +02:00
parent 6410660dc0
commit e865759650
@@ -11,6 +11,8 @@ async def safe_browser_operation(url, operation_func):
browser = None browser = None
context = None context = None
page = None page = None
playwright = None
try: try:
# Get or create playwright instance # Get or create playwright instance
playwright = await async_playwright().start() playwright = await async_playwright().start()
@@ -64,4 +66,10 @@ async def safe_browser_operation(url, operation_func):
await browser.close() await browser.close()
except Exception as e: except Exception as e:
print(f"Error closing browser: {e}") print(f"Error closing browser: {e}")
# We don't re-raise here to avoid masking the original error
# Ensure playwright is closed properly - THIS IS THE KEY FIX
if playwright:
try:
await playwright.stop()
except Exception as e:
print(f"Error closing playwright: {e}")