inspect to make sure the server itself is running, not just the thread the spawned the server

This commit is contained in:
John Bintz 2012-03-15 14:22:20 -04:00
parent d81b19de2d
commit 624e9007f3

View File

@ -30,9 +30,9 @@ module Flowerbox
end end
::Rack::Handler::Thin.run(app, server_options) do |server| ::Rack::Handler::Thin.run(app, server_options) do |server|
trap('QUIT') { server.stop }
Thread.current[:server] = server Thread.current[:server] = server
trap('QUIT') { server.stop }
end end
end end
@ -40,7 +40,7 @@ module Flowerbox
sleep 0.1 sleep 0.1
end end
raise StandardError.new("Server died") if !@server_thread.alive? raise StandardError.new("Server died") if !@server_thread[:server].running?
end end
def stop def stop