mini chunk size

This commit is contained in:
jxxghp
2025-09-12 21:45:26 +08:00
parent 3d43750e9b
commit 188de34306
5 changed files with 8 additions and 8 deletions

View File

@@ -23,7 +23,7 @@ def transfer_process(path: str) -> Callable[[int | float], None]:
"""
更新进度百分比
"""
percent_value = int(percent)
percent_value = round(percent, 2) if isinstance(percent, float) else percent
pbar.n = percent_value
# 更新进度
pbar.refresh()

View File

@@ -602,7 +602,7 @@ class AliPan(StorageBase, metaclass=WeakSingleton):
file_size = local_path.stat().st_size
# 1. 创建文件并检查秒传
chunk_size = 100 * 1024 * 1024 # 分片大小 100M
chunk_size = 10 * 1024 * 1024 # 分片大小 10M
create_res = self._create_file(drive_id=target_dir.drive_id,
parent_file_id=target_dir.fileid,
file_name=target_name,

View File

@@ -26,8 +26,8 @@ class LocalStorage(StorageBase):
"softlink": "软链接"
}
# 文件块大小默认100MB
chunk_size = 100 * 1024 * 1024
# 文件块大小默认10MB
chunk_size = 10 * 1024 * 1024
def init_storage(self):
"""

View File

@@ -39,8 +39,8 @@ class SMB(StorageBase, metaclass=WeakSingleton):
"copy": "复制",
}
# 文件块大小默认100MB
chunk_size = 100 * 1024 * 1024
# 文件块大小默认10MB
chunk_size = 10 * 1024 * 1024
def __init__(self):
super().__init__()

View File

@@ -540,8 +540,8 @@ class U115Pan(StorageBase, metaclass=WeakSingleton):
security_token=SecurityToken
)
bucket = oss2.Bucket(auth, endpoint, bucket_name) # noqa
# determine_part_size方法用于确定分片大小设置分片大小为 100M
part_size = determine_part_size(file_size, preferred_size=100 * 1024 * 1024)
# determine_part_size方法用于确定分片大小设置分片大小为 10M
part_size = determine_part_size(file_size, preferred_size=10 * 1024 * 1024)
# 初始化进度条
logger.info(f"【115】开始上传: {local_path} -> {target_path},分片大小:{StringUtils.str_filesize(part_size)}")