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 10d7d5e8 Add timestamps
10d7d5e8 is described below
commit 10d7d5e870a6261b0dd9ab0720a0c3d1ba567a84
Author: Sebb <[email protected]>
AuthorDate: Sun May 22 22:45:00 2022 +0100
Add timestamps
---
tools/site-scan.rb | 4 ++++
www/status/monitors/site_scan.rb | 3 +++
2 files changed, 7 insertions(+)
diff --git a/tools/site-scan.rb b/tools/site-scan.rb
index e21e5fb3..90b26e11 100755
--- a/tools/site-scan.rb
+++ b/tools/site-scan.rb
@@ -215,6 +215,8 @@ podlings = {}
$cache = Cache.new(dir: 'site-scan')
$verbose = ARGV.delete '--verbose'
+puts "Started: #{Time.now}" # must agree with site-scan monitor
+
# USAGE:
# site-scan.rb https://whimsical.apache.org [Whimsy] [whimsy-scan.json] - to
scan one project
# site-scan.rb [project-output.json] [podlings-output.json] [projname
podlingname ...]
@@ -273,3 +275,5 @@ if output_podlings
else
puts JSON.pretty_generate(podlings)
end
+
+puts "Ended: #{Time.now}" # must agree with site-scan monitor
diff --git a/www/status/monitors/site_scan.rb b/www/status/monitors/site_scan.rb
index f39347e8..214a5636 100644
--- a/www/status/monitors/site_scan.rb
+++ b/www/status/monitors/site_scan.rb
@@ -19,7 +19,10 @@ def Monitor.site_scan(previous_status)
logfile = File.join(logdir, 'site-scan')
log = File.read(logfile)
+ # Drop standard cache info
log.gsub! /^([-\w]+ )*https?:\S+ \w+\n/, ''
+ # Drop other info (must agree with scanner script)
+ log.gsub! %r{^(Started|Ended):.+\n}, ''
danger_period = 86_400 # one day