Skip to content
Snippets Groups Projects
Commit 59180ec3 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

audit: improve reliability of homepage audit.

- Don't run on Yosemite where the system Curl is too old for some modern
  HTTPS homepages
- Try up to 3 times in case of transient failures.
parent 6f44dc41
No related branches found
No related tags found
No related merge requests found
......@@ -569,9 +569,20 @@ class FormulaAuditor
end
return unless @online
status_code, = curl_output "--connect-timeout", "15", "--output", "/dev/null", "--range", "0-0",
"--write-out", "%{http_code}", homepage
return if status_code.start_with? "20"
# The system Curl is too old and unreliable with HTTPS homepages on
# Yosemite and below.
return unless MacOS.version >= :el_capitan
retries = 3
retries.times do
status_code, = curl_output "--connect-timeout", "15",
"--output", "/dev/null",
"--range", "0-0",
"--write-out", "%{http_code}",
homepage
return if status_code.start_with? "20"
end
problem "The homepage #{homepage} is not reachable (HTTP status code #{status_code})"
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment