Skip to content

Automate browser based workflows with AI

add get page video timeout (#1710)

Shuchang Zhengf0b274d31da6
diff --git a/skyvern/webeye/browser_factory.py b/skyvern/webeye/browser_factory.py
index ae4ff0655..23561ae60 100644
--- a/skyvern/webeye/browser_factory.py
+++ b/skyvern/webeye/browser_factory.py
@@ -480,14 +480,22 @@ class BrowserState:
return
if len(self.browser_artifacts.video_artifacts) > index:
if self.browser_artifacts.video_artifacts[index].video_path is None:
- self.browser_artifacts.video_artifacts[index].video_path = await page.video.path()
+ try:
+ async with asyncio.timeout(settings.BROWSER_ACTION_TIMEOUT_MS / 1000):
+ self.browser_artifacts.video_artifacts[index].video_path = await page.video.path()
+ except asyncio.TimeoutError:
+ LOG.info("Timeout to get the page video, skip the exception")
return
target_lenght = index + 1
self.browser_artifacts.video_artifacts.extend(
[VideoArtifact()] * (target_lenght - len(self.browser_artifacts.video_artifacts))
)
- self.browser_artifacts.video_artifacts[index].video_path = await page.video.path()
+ try:
+ async with asyncio.timeout(settings.BROWSER_ACTION_TIMEOUT_MS / 1000):
+ self.browser_artifacts.video_artifacts[index].video_path = await page.video.path()
+ except asyncio.TimeoutError:
+ LOG.info("Timeout to get the page video, skip the exception")
return
async def get_or_create_page(