Skip to content

Commit

Permalink
add get page video timeout (#1710)
Browse files Browse the repository at this point in the history
  • Loading branch information
wintonzheng authored Feb 4, 2025
1 parent 59756cb commit f0b274d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions skyvern/webeye/browser_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,14 +480,22 @@ async def set_working_page(self, page: Page | None, index: int = 0) -> None:
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(
Expand Down

0 comments on commit f0b274d

Please sign in to comment.