Skip to content

Commit

Permalink
Fix IO error caused by the external repository: IO has already been r…
Browse files Browse the repository at this point in the history
…ead and cannot be read again in chunks.
  • Loading branch information
eugenk authored and Tom Gehrke committed Aug 13, 2016
1 parent 6a8df19 commit 59611bb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/uri_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ def produce_response_body(response, write_file=nil)
if write_file
File.open(write_file.to_s, 'w') do |file|
file.flock(File::LOCK_EX)
response.read_body do |chunk|
file.write chunk
end
file.write(response.read_body)
end
write_file
else
Expand Down

0 comments on commit 59611bb

Please sign in to comment.