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 b0967ba  Enable updates on new whimsy host
b0967ba is described below

commit b0967baf908c19e3a12a550a33f30c6f2f945cdd
Author: Sebb <[email protected]>
AuthorDate: Sun Sep 20 12:22:35 2020 +0100

    Enable updates on new whimsy host
---
 www/board/agenda/routes.rb        | 11 ++++++++---
 www/secretary/workbench/server.rb | 12 +++++++++---
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/www/board/agenda/routes.rb b/www/board/agenda/routes.rb
index 4399fe7..afc8955 100755
--- a/www/board/agenda/routes.rb
+++ b/www/board/agenda/routes.rb
@@ -2,9 +2,14 @@
 # Server side Sinatra routes
 #
 
-# disable all update actions
-UNAVAILABLE = 'Service temporarily unavailable due to migration.'
-# set the constant to nil to re-enable
+require_relative '../../whimsy'
+if Whimsy.master?
+  UNAVAILABLE = nil # updates allowed
+else
+  # disable all update actions
+  # UNAVAILABLE = 'Service temporarily unavailable due to migration.'
+  UNAVAILABLE = 'Service unavailable on this node. Please ensure you have 
logged in to the correct host.'
+end
 
 # redirect root to latest agenda
 get '/' do
diff --git a/www/secretary/workbench/server.rb 
b/www/secretary/workbench/server.rb
index e9e8299..48cab15 100644
--- a/www/secretary/workbench/server.rb
+++ b/www/secretary/workbench/server.rb
@@ -52,9 +52,15 @@ set :show_exceptions, true
 
 disable :logging # suppress log of requests to stderr/error.log
 
-# disable all update actions
-UNAVAILABLE = 'Service temporarily unavailable due to migration.'
-# set the constant to nil to re-enable
+require_relative '../../whimsy'
+if Whimsy.master?
+  UNAVAILABLE = nil # updates allowed
+else
+  # disable all update actions
+  # UNAVAILABLE = 'Service temporarily unavailable due to migration.'
+  UNAVAILABLE = 'Service unavailable on this node. Please ensure you have 
logged in to the correct host.'
+end
+
 
 # list of messages
 get '/' do

Reply via email to