diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-08-04 14:27:52 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-08-04 14:27:52 +0100 |
commit | 02a177d8e744f7e084bc69d10a0b7f8fb7e3bd44 (patch) | |
tree | ba46705bc35bc3b8f0e01ac05bd6879e2c9d448e /lib/mauve/http_server.rb | |
parent | 10141ed04af966ee280dcea1d733e0b036127afc (diff) | |
parent | 451e7fac0b7cb6c7cb3659c8a4acceaab6125123 (diff) |
merge
Diffstat (limited to 'lib/mauve/http_server.rb')
-rw-r--r-- | lib/mauve/http_server.rb | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/mauve/http_server.rb b/lib/mauve/http_server.rb index d0ee29f..2b8d5cf 100644 --- a/lib/mauve/http_server.rb +++ b/lib/mauve/http_server.rb @@ -2,7 +2,6 @@ # # Bleuurrgggggh! Bleurrrrrgghh! # -require 'mauve/auth_bytemark' require 'mauve/web_interface' require 'mauve/mauve_thread' require 'digest/sha1' @@ -136,11 +135,13 @@ module Mauve end def main_loop - # - # Sessions are kept for 8 days. - # - @server = ::Thin::Server.new(@ip, @port, Rack::Session::Cookie.new(WebInterface.new, {:key => "mauvealert", :secret => @session_secret, :expire_after => 691200}), :signals => false) - @server.start + unless @server and @server.running? + # + # Sessions are kept for 8 days. + # + @server = ::Thin::Server.new(@ip, @port, Rack::Session::Cookie.new(WebInterface.new, {:key => "mauvealert", :secret => @session_secret, :expire_after => 691200}), :signals => false) + @server.start + end end def base_url @@ -148,8 +149,14 @@ module Mauve end def stop - @server.stop if @server + @server.stop if @server and @server.running? super end + + def join + @server.stop! if @server and @server.running? + super + end + end end |