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