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 c9a419dd Load status once
c9a419dd is described below

commit c9a419dda48eae2677e6356fbd4b263ffd024889
Author: Sebb <[email protected]>
AuthorDate: Sun Jan 14 17:14:08 2024 +0000

    Load status once
---
 www/status/index.cgi               | 3 ++-
 www/status/monitors/public_json.rb | 1 -
 www/status/monitors/system.rb      | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/www/status/index.cgi b/www/status/index.cgi
index 2aef4bad..238bed83 100755
--- a/www/status/index.cgi
+++ b/www/status/index.cgi
@@ -1,8 +1,9 @@
 #!/usr/bin/env ruby
-$LOAD_PATH.unshift '/srv/whimsy/lib' # public_json.rb needs this
+$LOAD_PATH.unshift '/srv/whimsy/lib'
 
 require 'json'
 require 'time'
+require 'whimsy/asf/status'
 
 json = File.expand_path('../status.json', __FILE__)
 status = JSON.parse(File.read(json)) rescue {}
diff --git a/www/status/monitors/public_json.rb 
b/www/status/monitors/public_json.rb
index 3d608245..a62e37d9 100644
--- a/www/status/monitors/public_json.rb
+++ b/www/status/monitors/public_json.rb
@@ -30,7 +30,6 @@ def Monitor.public_json(previous_status)
 
   status = {}
 
-  require 'whimsy/asf/status'
   sendMail = Status.active?
  
   Dir[logs].each do |log|
diff --git a/www/status/monitors/system.rb b/www/status/monitors/system.rb
index 9699ccdf..f326028e 100644
--- a/www/status/monitors/system.rb
+++ b/www/status/monitors/system.rb
@@ -42,7 +42,6 @@ def Monitor.system(previous_status)
 
   # Are we the active node?
   begin
-    require_relative '../../../lib/whimsy/asf/status'
     active = Status.active?
     rescue LoadError, StandardError => e
       active = e.inspect

Reply via email to