Merge pull request #1323 from simon04/download-failed

prepare_deploy: report which download has failed
pull/1324/merge
Simon Legner 4 years ago committed by GitHub
commit 634d3c7592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -244,11 +244,17 @@ class DocsCLI < Thor
FileUtils.mkpath(dir)
['index.json', 'meta.json'].each do |filename|
open("https://docs.devdocs.io/#{doc.path}/#{filename}?#{time}") do |file|
mutex.synchronize do
path = File.join(dir, filename)
File.write(path, file.read)
json = "https://docs.devdocs.io/#{doc.path}/#{filename}?#{time}"
begin
open(json) do |file|
mutex.synchronize do
path = File.join(dir, filename)
File.write(path, file.read)
end
end
rescue => e
puts "Docs -- Failed to download #{json}!"
throw e
end
end

Loading…
Cancel
Save