Skip to content

Commit

Permalink
feat: do not re-download files if local size big enough (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
xyb authored Nov 24, 2023
1 parent 4d9f0b0 commit 633db08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions task/baidupcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def download_file(self, remote_path, local_dir, file_size, sample_size=0):
local_path.parent.mkdir(parents=True)

if local_path.exists():
if (sample_size and sample_size == getsize(local_path)) or (
not sample_size and file_size == getsize(local_path)
if (sample_size and sample_size <= getsize(local_path)) or (
not sample_size and file_size <= getsize(local_path)
):
logger.info(f"{local_path} is ready existed.")
return
Expand Down

0 comments on commit 633db08

Please sign in to comment.