diff --git a/skyvern/constants.py b/skyvern/constants.py index 372868c6..ce485d91 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 a2f00890..449ad356 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)