lower default page loading time from 90 seconds to 60 seconds (#4076)
This commit is contained in:
@@ -41,7 +41,7 @@ class Settings(BaseSettings):
|
||||
TEMP_PATH: str = "./temp"
|
||||
BROWSER_ACTION_TIMEOUT_MS: int = 5000
|
||||
BROWSER_SCREENSHOT_TIMEOUT_MS: int = 20000
|
||||
BROWSER_LOADING_TIMEOUT_MS: int = 90000
|
||||
BROWSER_LOADING_TIMEOUT_MS: int = 60000
|
||||
BROWSER_SCRAPING_BUILDING_ELEMENT_TREE_TIMEOUT_MS: int = 60 * 1000 # 1 minute
|
||||
OPTION_LOADING_TIMEOUT_MS: int = 600000
|
||||
MAX_STEPS_PER_RUN: int = 10
|
||||
|
||||
@@ -402,7 +402,7 @@ class ScriptSkyvernPage(SkyvernPage):
|
||||
if context and context.script_mode:
|
||||
print(f"🌐 Navigating to: {url}")
|
||||
|
||||
timeout = kwargs.pop("timeout", settings.BROWSER_ACTION_TIMEOUT_MS)
|
||||
timeout = kwargs.pop("timeout", settings.BROWSER_LOADING_TIMEOUT_MS)
|
||||
await self.page.goto(url, timeout=timeout, **kwargs)
|
||||
|
||||
if context and context.script_mode:
|
||||
|
||||
@@ -93,7 +93,7 @@ class SkyvernPage(Page):
|
||||
return decorator
|
||||
|
||||
async def goto(self, url: str, **kwargs: Any) -> None:
|
||||
timeout = kwargs.pop("timeout", settings.BROWSER_ACTION_TIMEOUT_MS)
|
||||
timeout = kwargs.pop("timeout", settings.BROWSER_LOADING_TIMEOUT_MS)
|
||||
await self.page.goto(url, timeout=timeout, **kwargs)
|
||||
|
||||
######### Public Interfaces #########
|
||||
|
||||
@@ -443,7 +443,7 @@ class ForgeAgent:
|
||||
page = await browser_state.must_get_working_page()
|
||||
current_url = page.url
|
||||
if current_url.rstrip("/") != task.url.rstrip("/"):
|
||||
await page.goto(task.url)
|
||||
await page.goto(task.url, timeout=settings.BROWSER_LOADING_TIMEOUT_MS)
|
||||
step = await self.update_step(
|
||||
step, status=StepStatus.completed, is_last=True, output=AgentStepOutput(action_results=[])
|
||||
)
|
||||
|
||||
@@ -657,7 +657,7 @@ async def run_task_v2_helper(
|
||||
# Page failed to load properly, fallback to Google
|
||||
if page:
|
||||
try:
|
||||
await page.goto(fallback_url, timeout=15000)
|
||||
await page.goto(fallback_url, timeout=settings.BROWSER_LOADING_TIMEOUT_MS)
|
||||
fallback_occurred = True
|
||||
except Exception:
|
||||
LOG.exception("Failed to load Google fallback", exc_info=True, url=url, current_url=current_url)
|
||||
|
||||
Reference in New Issue
Block a user