Open incomplete download in append mode
Open the incomplete download in append mode instead of write mode. Opening in write mode truncates the existing file, so curl keeps restarting downloads instead of resuming the incomplete downloads.
This commit is contained in:
parent
79e8cdd3ed
commit
6a406763f3
@ -105,7 +105,7 @@ module Hbc
|
||||
else
|
||||
had_incomplete_download = temporary_path.exist?
|
||||
begin
|
||||
File.open(temporary_path, "w+") do |f|
|
||||
File.open(temporary_path, "a+") do |f|
|
||||
f.flock(File::LOCK_EX)
|
||||
_fetch
|
||||
f.flock(File::LOCK_UN)
|
||||
|
Loading…
x
Reference in New Issue
Block a user