diff options
Diffstat (limited to 'railties/lib/fcgi_handler.rb')
-rw-r--r-- | railties/lib/fcgi_handler.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/railties/lib/fcgi_handler.rb b/railties/lib/fcgi_handler.rb index 3124a1e5e6..ee33c7ff36 100644 --- a/railties/lib/fcgi_handler.rb +++ b/railties/lib/fcgi_handler.rb @@ -64,7 +64,14 @@ class RailsFCGIHandler process_request(cgi) # Break if graceful exit or restart requested. - break if when_ready == :exit || when_ready == :restart + case when_ready + when :exit + close_connection + break + when :restart + close_connection + restart! + end # Garbage collection countdown. if gc_request_period @@ -73,8 +80,6 @@ class RailsFCGIHandler end end - restart! if when_ready == :restart - GC.enable dispatcher_log :info, "terminated gracefully" @@ -172,4 +177,8 @@ class RailsFCGIHandler @gc_request_countdown = gc_request_period GC.enable; GC.start; GC.disable end + + def close_connection + cgi.instance_variable_get("@request").finish + end end |