This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 0c96ce35 Don't keep checking resources after multiple fails
0c96ce35 is described below
commit 0c96ce35bd62eebf0903d83b14c5df04db190dce
Author: Sebb <[email protected]>
AuthorDate: Mon Sep 23 15:40:48 2024 +0100
Don't keep checking resources after multiple fails
---
tools/site-scan.rb | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/site-scan.rb b/tools/site-scan.rb
index 8d197a65..31b81423 100755
--- a/tools/site-scan.rb
+++ b/tools/site-scan.rb
@@ -343,6 +343,8 @@ $cache = Cache.new(dir: ENV['SITE_SCAN_CACHE'] ||
'site-scan')
$verbose = ARGV.delete '--verbose'
$saveparse = ARGV.delete '--saveparse'
$skipresourcecheck = ARGV.delete '--noresource'
+sites_checked = 0
+sites_failed = 0
k = ARGV.select {|k| k.start_with? '-'}
if k.size > 0
@@ -385,6 +387,10 @@ else
next unless ARGV.include? committee.name
end
results[committee.name] = parse(committee.name, committee.site,
committee.display_name)
+ sites_checked += 1
+ sites_failed += 1 unless results[committee.name][:resources].start_with?
'Found'
+ # Don't keep checking unnecessarily
+ $skipresourcecheck = (sites_failed > 10 or (sites_failed > 3 and
sites_failed == sites_checked))
end
# Scan podlings that have a website