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

This commit is contained in:
Shuchang Zheng
2025-04-28 14:37:41 +08:00
committed by GitHub
parent 0a0228b341
commit 8b184ce970
2 changed files with 13 additions and 9 deletions

View File

@@ -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

View File

@@ -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)