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 c28ad1f Allow WSS to start before SVN checkout is completed
c28ad1f is described below
commit c28ad1fca297da3284ff483651dafd6d29b8f789
Author: Sebb <[email protected]>
AuthorDate: Tue Jan 7 15:34:24 2020 +0000
Allow WSS to start before SVN checkout is completed
---
tools/download_url.rb | 22 ++++++++++++++++++++++
www/board/agenda/daemon/channel.rb | 3 ++-
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/tools/download_url.rb b/tools/download_url.rb
new file mode 100644
index 0000000..4eff518
--- /dev/null
+++ b/tools/download_url.rb
@@ -0,0 +1,22 @@
+#!/usr/bin/env ruby
+
+# Check a URL
+
+require 'net/http'
+
+def HEAD(url)
+ url.untaint
+ uri = URI.parse(url)
+ unless uri.scheme
+ puts "No scheme for URL #{url}, assuming http"
+ uri = URI.parse("http:"+url)
+ end
+ http = Net::HTTP.new(uri.host, uri.port)
+ http.use_ssl = uri.scheme == 'https'
+ request = Net::HTTP::Head.new(uri.request_uri)
+ http.request(request)
+end
+
+response = HEAD
'http://apache.claz.org/jspwiki/2.11.0.M6/source/jspwiki-builder-2.11.0.M6-source-release.zip'
+p response
+p response.code
diff --git a/www/board/agenda/daemon/channel.rb
b/www/board/agenda/daemon/channel.rb
index 973ec38..ceef91b 100644
--- a/www/board/agenda/daemon/channel.rb
+++ b/www/board/agenda/daemon/channel.rb
@@ -17,7 +17,8 @@ class Channel
@@sockets = Concurrent::Map.new
@@users = Concurrent::Map.new {|map,key| map[key]=[]}
- FOUNDATION_BOARD = ASF::SVN['foundation_board']
+ # rescue value is to help with startup when initialising a new host
+ FOUNDATION_BOARD = ASF::SVN['foundation_board'] rescue
'/srv/foundation_board'
# add a new socket/userid pair
def self.add(ws, id)