Permalink
Browse files

Merge branch 'release-3.7.x'

  • Loading branch information...
ddfreyne committed Nov 3, 2014
2 parents bf03823 + e49afdf commit 01e0f37d2637e25f8244793fb0fd66bd7e7fcc07
Showing with 10 additions and 3 deletions.
  1. +10 −3 lib/nanoc/extra/checking/checks/external_links.rb
@@ -100,16 +100,19 @@ def validate(href)
# Get status
res = nil
last_err = nil
timeouts = [3, 5, 10, 30, 60]
5.times do |i|
begin
Timeout.timeout(10) do
Timeout.timeout(timeouts[i]) do
res = request_url_once(url)
if res.code == '405'
res = request_url_once(url, Net::HTTP::Get)
end
end
rescue => e
return Result.new(href, e.message)
last_err = e
next # can not allow
end
if res.code =~ /^3..$/
@@ -134,7 +137,11 @@ def validate(href)
return Result.new(href, res.code)
end
end
raise 'should not have gotten here'
if last_err
return Result.new(href, last_err.message)
else
raise 'should not have gotten here'
end
end
def path_for_url(url)

0 comments on commit 01e0f37

Please sign in to comment.