If the download fails, delete the half-file
Otherwise next time it will assume the half-file is the whole file and fail the md5 check.
This commit is contained in:
parent
ce3b7c9826
commit
5eb51cb766
@ -42,6 +42,9 @@ class HttpDownloadStrategy <AbstractDownloadStrategy
|
|||||||
puts "File already downloaded and cached"
|
puts "File already downloaded and cached"
|
||||||
end
|
end
|
||||||
return @dl # thus performs checksum verification
|
return @dl # thus performs checksum verification
|
||||||
|
rescue Exception
|
||||||
|
@dl.unlink
|
||||||
|
raise "There was an error downloading the file:\n#{@url}"
|
||||||
end
|
end
|
||||||
def stage
|
def stage
|
||||||
case `file -b #{@dl}`
|
case `file -b #{@dl}`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user