You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2022/05/22 18:51:08 UTC
[whimsy] branch master updated: Reduce level
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 91abdcb8 Reduce level
91abdcb8 is described below
commit 91abdcb85dfbef726899f2ac11e8352f08d3449b
Author: Sebb <se...@apache.org>
AuthorDate: Sun May 22 19:51:00 2022 +0100
Reduce level
---
tools/site-scan.rb | 4 ++--
www/status/monitors/site_scan.rb | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/site-scan.rb b/tools/site-scan.rb
index ec6392e4..7ef030a8 100755
--- a/tools/site-scan.rb
+++ b/tools/site-scan.rb
@@ -191,8 +191,8 @@ def exec_with_timeout(cmd, timeout)
rescue Timeout::Error
# Try to determine why the kill does not tidy the chrome processes
# Also whether a kill was actually issued!
- puts "ERR: timeout scanning #{cmd[-1]}"
- $stderr.puts "ERR: timeout scanning #{cmd[-1]}"
+ puts "WARN: timeout scanning #{cmd[-1]}"
+ $stderr.puts "WARN: timeout scanning #{cmd[-1]}"
stderr = 'Timeout'
Process.kill(-9, pid)
Process.detach(pid)
diff --git a/www/status/monitors/site_scan.rb b/www/status/monitors/site_scan.rb
index 167fc770..f39347e8 100644
--- a/www/status/monitors/site_scan.rb
+++ b/www/status/monitors/site_scan.rb
@@ -26,12 +26,13 @@ def Monitor.site_scan(previous_status)
if not log.empty?
# Archive the log file
require 'fileutils'
- archive = File.join(logdir,'archive')
+ archive = File.join(logdir, 'archive')
FileUtils.mkdir(archive) unless File.directory?(archive)
file = File.basename(logfile)
- FileUtils.copy logfile, File.join(archive, file + '.danger'), preserve: true
level = 'danger'
level = 'warning' if log.gsub(/.* error\n/, '').empty?
+ level = 'warning' if log.gsub(/WARN: timeout scanning.*\n/, '').empty?
+ FileUtils.copy logfile, File.join(archive, file + '.' + level), preserve: true
{
level: level,
data: log.split("\n"),