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

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