Skip to content

Commit ad405f4

Browse files
committed
feat: do not re-download files if local size big enough
1 parent 4d9f0b0 commit ad405f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

task/baidupcs.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ def download_file(self, remote_path, local_dir, file_size, sample_size=0):
110110
local_path.parent.mkdir(parents=True)
111111

112112
if local_path.exists():
113-
if (sample_size and sample_size == getsize(local_path)) or (
114-
not sample_size and file_size == getsize(local_path)
113+
if (sample_size and sample_size <= getsize(local_path)) or (
114+
not sample_size and file_size <= getsize(local_path)
115115
):
116116
logger.info(f"{local_path} is ready existed.")
117117
return

0 commit comments

Comments
 (0)