whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Use new Status module
Date Wed, 23 Sep 2020 16:15:57 GMT
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 ef1df38  Use new Status module
ef1df38 is described below

commit ef1df38e316f09f5118bc38e0579ee049848bd3c
Author: Sebb <sebb@apache.org>
AuthorDate: Wed Sep 23 17:15:48 2020 +0100

    Use new Status module
---
 www/roster/public_json_common.rb |  6 +++---
 www/status/monitors/system.rb    | 18 +++++++++---------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/www/roster/public_json_common.rb b/www/roster/public_json_common.rb
index f70197c..9679cd1 100644
--- a/www/roster/public_json_common.rb
+++ b/www/roster/public_json_common.rb
@@ -82,9 +82,9 @@ def public_json_output_file(info, file)
 end
 
 def sendMail(subject, body, to='Notification List <notifications@whimsical.apache.org>')
-  require_relative '../whimsy'
-  if not Whimsy.master?
-    Wunderbar.info "Did not detect master status, not sending mail: #{subject}"
+  require 'whimsy/asf/status'
+  unless Status.active?
+    Wunderbar.info "Did not detect active status, not sending mail: #{subject}"
     return
   end
   begin
diff --git a/www/status/monitors/system.rb b/www/status/monitors/system.rb
index 1c5fe4a..60f203e 100644
--- a/www/status/monitors/system.rb
+++ b/www/status/monitors/system.rb
@@ -40,19 +40,19 @@ def Monitor.system(previous_status)
     }
   end
 
-  # Are we the master node?
+  # Are we the active node?
   begin
-    require_relative '../../whimsy'
-    master = Whimsy.master?
+    require 'whimsy/asf/status'
+    active = Status.active?
     rescue LoadError, StandardError => e
-      master = e.inspect
+      active = e.inspect
   end
-  name = :master
-  status[name] = {command: 'Whimsy.master?'}
+  name = :active
+  status[name] = {command: 'Status.active?'}
   # TODO change the false level to warning or danger at some point?
-  # N.B. need to compare with true as master may be a string, i.e. 'truthy'
-  status[name] = {level: master == true ? 'success' : 'warning',
-                  data: master.to_s}
+  # N.B. need to compare with true as active may be a string, i.e. 'truthy'
+  status[name] = {level: active == true ? 'success' : 'warning',
+                  data: active.to_s}
 
   {data: status}
 end


Mime
View raw message