diff --git a/script/factory_sliceing/download_print_out.py b/script/factory_sliceing/download_print_out.py index 4fd634c..9d535ae 100644 --- a/script/factory_sliceing/download_print_out.py +++ b/script/factory_sliceing/download_print_out.py @@ -73,6 +73,7 @@ class DataTransfer: break print(f"objects={objects}") + download_count = 0 # 下载所有文件,添加进度条 for obj_key in tqdm(objects, desc="下载进度"): if obj_key.endswith('/'): @@ -117,7 +118,7 @@ class DataTransfer: # 下载文件 self.oss_client.get_object_to_file(obj_key, local_path) - + download_count += 1 if file_ext == '.obj': # 10MB以上 try: # 使用临时文件避免内存问题 [8](@ref) @@ -179,6 +180,13 @@ class DataTransfer: print(f"下载文件: {obj_key} -> {local_path}") + + if download_count != 3: + print(f"下载文件数量不正确: {download_count}") + #直接杀死进程 + os._exit(1) + return True + import requests import json import shutil