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 2016/04/08 15:47:29 UTC

[whimsy] branch master updated: No point checking for status change if there was an exception

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git

The following commit(s) were added to refs/heads/master by this push:
       new  058515b   No point checking for status change if there was an exception
058515b is described below

commit 058515b55f19b2b39651b584f1d48951706bea4f
Author: Sebb <se...@apache.org>
AuthorDate: Fri Apr 8 14:47:20 2016 +0100

    No point checking for status change if there was an exception
---
 www/status/monitors/public_json.rb | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/www/status/monitors/public_json.rb b/www/status/monitors/public_json.rb
index f946a3c..466f31c 100644
--- a/www/status/monitors/public_json.rb
+++ b/www/status/monitors/public_json.rb
@@ -81,6 +81,19 @@ def Monitor.public_json(previous_status)
       if status[name][:data]
         status[name].delete_if { |k, v| k.eql? :title}
       end
+
+      # Has there been a change since the last check?
+      if previous_status[:data] and status[name] != previous_status[:data][name]
+        lvl = status[name][:level] 
+        #      $stderr.puts "Status has changed for #{name} #{lvl}"
+        if lvl and lvl != 'info' and lvl != 'success' # was there a problem?
+          # Save a copy of the log; append the severity so can track more problems
+          file = File.basename(log)
+          FileUtils.copy log, File.join(archive, file + '.' + lvl), preserve: true
+          $stderr.puts "Would send e-mail for #{name} #{lvl}"
+        end
+      end
+
     rescue Exception => e
       status[name] = {
         level: 'danger',
@@ -93,18 +106,6 @@ def Monitor.public_json(previous_status)
         }
       }
     end
-
-    # Has there been a change since the last check?
-    if previous_status[:data] and status[name] != previous_status[:data][name]
-      lvl = status[name][:level] 
-#      $stderr.puts "Status has changed for #{name} #{lvl}"
-      if lvl and lvl != 'info' and lvl != 'success' # was there a problem?
-        # Save a copy of the log; append the severity so can track more problems
-        name = File.basename(log)
-        FileUtils.copy log, File.join(archive, name + '.' + lvl), preserve: true
-        $stderr.puts "Would send e-mail for #{name} #{lvl}"
-      end
-    end
   end
 
   {data: status}

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].