wait for downloads to be done (#1328)

This commit is contained in:
LawyZheng
2024-12-06 02:25:13 +08:00
committed by GitHub
parent da4e145941
commit df4d5df48d
3 changed files with 104 additions and 31 deletions

View File

@@ -331,6 +331,15 @@ class ForgeAgent:
files_to_rename = list(set(list_files_after) - set(list_files_before))
for file in files_to_rename:
file_extension = Path(file).suffix
if file_extension == ".crdownload":
LOG.warning(
"Detecting incompleted download file, skip the rename",
file=file,
task_id=task.task_id,
workflow_run_id=task.workflow_run_id,
)
continue
random_file_id = "".join(random.choices(string.ascii_uppercase + string.digits, k=4))
random_file_name = f"download-{datetime.now().strftime('%Y%m%d%H%M%S%f')}-{random_file_id}"
if task_block.download_suffix: