From 624e9007f32032ca24082bfd61e638141623610f Mon Sep 17 00:00:00 2001 From: John Bintz Date: Thu, 15 Mar 2012 14:22:20 -0400 Subject: [PATCH] inspect to make sure the server itself is running, not just the thread the spawned the server --- lib/flowerbox/delivery/server.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/flowerbox/delivery/server.rb b/lib/flowerbox/delivery/server.rb index 8e696a2..f677902 100644 --- a/lib/flowerbox/delivery/server.rb +++ b/lib/flowerbox/delivery/server.rb @@ -30,9 +30,9 @@ module Flowerbox end ::Rack::Handler::Thin.run(app, server_options) do |server| - trap('QUIT') { server.stop } - Thread.current[:server] = server + + trap('QUIT') { server.stop } end end @@ -40,7 +40,7 @@ module Flowerbox sleep 0.1 end - raise StandardError.new("Server died") if !@server_thread.alive? + raise StandardError.new("Server died") if !@server_thread[:server].running? end def stop