File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -165,14 +165,21 @@ def download(
165165 temp_dest = os .path .join (Paths .temp , file )
166166 just_downloaded = False
167167
168- if os .path .isfile (os .path .join (Paths .temp , existing_file )):
168+ file_path = os .path .join (Paths .temp , existing_file )
169+ if os .path .isfile (file_path ):
169170 """
170171 Check if the file already exists in the /temp directory.
171- If so, then skip the download process and set the update_func
172- to completed .
172+ If it's a 0-byte empty file, remove it to allow a fresh download.
173+ Otherwise, skip the download .
173174 """
174- logging .warning (f"File [{ existing_file } ] already exists in temp, skipping." )
175- else :
175+ if os .path .getsize (file_path ) == 0 :
176+ logging .warning (f"File [{ existing_file } ] is a 0-byte empty file. Removing to force re-download." )
177+ os .remove (file_path )
178+ else :
179+ logging .warning (f"File [{ existing_file } ] already exists in temp, skipping." )
180+ return Result (True )
181+
182+ if not os .path .isfile (file_path ):
176183 """
177184 As some urls can be redirect, we need to take care of this
178185 and make sure to use the final url. This check should be
You can’t perform that action at this time.
0 commit comments