111
This commit is contained in:
1 parent
6ba4546368
commit
914c442524
1 file changed
+9
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user