Skip to content

Automate browser based workflows with AI

increase download max wait time and change logs (#2232)

Shuchang Zheng8b184ce97018
diff --git a/skyvern/constants.py b/skyvern/constants.py
index 372868c61..ce485d910 100644
--- a/skyvern/constants.py
+++ b/skyvern/constants.py
@@ -10,7 +10,7 @@ INPUT_TEXT_TIMEOUT = 120000 # 2 minutes
PAGE_CONTENT_TIMEOUT = 300 # 5 mins
BUILDING_ELEMENT_TREE_TIMEOUT_MS = 60 * 1000 # 1 minute
BROWSER_CLOSE_TIMEOUT = 180 # 3 minute
-BROWSER_DOWNLOAD_MAX_WAIT_TIME = 120 # 2 minute
+BROWSER_DOWNLOAD_MAX_WAIT_TIME = 1200 # 20 minute
BROWSER_DOWNLOAD_TIMEOUT = 600 # 10 minute
DOWNLOAD_FILE_PREFIX = "downloads"
SAVE_DOWNLOADED_FILES_TIMEOUT = 180
diff --git a/skyvern/webeye/actions/handler.py b/skyvern/webeye/actions/handler.py
index a2f00890b..449ad3560 100644
--- a/skyvern/webeye/actions/handler.py
+++ b/skyvern/webeye/actions/handler.py
@@ -620,18 +620,22 @@ async def handle_click_to_download_file_action(
return [ActionFailure(e, download_triggered=False)]
try:
+ LOG.info(
+ "Checking if there is any new files after click",
+ download_dir=download_dir,
+ )
async with asyncio.timeout(BROWSER_DOWNLOAD_MAX_WAIT_TIME):
while True:
list_files_after = list_files_in_directory(download_dir)
- LOG.info(
- "Number of files in download directory after click",
- num_downloaded_files_after=len(list_files_after),
- download_dir=download_dir,
- task_id=task.task_id,
- step_id=step.step_id,
- workflow_run_id=task.workflow_run_id,
- )
if len(list_files_after) > len(list_files_before):
+ LOG.info(
+ "Found new files in download directory after click",
+ num_downloaded_files_after=len(list_files_after),
+ download_dir=download_dir,
+ task_id=task.task_id,
+ step_id=step.step_id,
+ workflow_run_id=task.workflow_run_id,
+ )
break
await asyncio.sleep(1)