about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-06-15 01:10:07 +0000
committerEric Wong <normalperson@yhbt.net>2011-06-15 01:27:17 +0000
commit4beeb52b1c52ea4486dea13cebe2a8438a9f2139 (patch)
treee1f57a5e205755c62e4a02d6767ccba6b1a51633 /lib
parente9e7a1c7c1778ed7cd7c724b26362d1f89b2801c (diff)
downloadunicorn-4beeb52b1c52ea4486dea13cebe2a8438a9f2139.tar.gz
There's absolutely no need to keep the OptionParser around in
worker processes.
Diffstat (limited to 'lib')
-rw-r--r--lib/unicorn.rb4
-rw-r--r--lib/unicorn/http_server.rb4
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index f9aa73a..9349e49 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -31,9 +31,9 @@ module Unicorn
   # app (which we defer based on the outcome of "preload_app" in the
   # Unicorn config).  The returned lambda will be called when it is
   # time to build the app.
-  def self.builder(ru, opts)
+  def self.builder(ru, op)
     # allow Configurator to parse cli switches embedded in the ru file
-    Unicorn::Configurator::RACKUP.update(:file => ru, :optparse => opts)
+    op = Unicorn::Configurator::RACKUP.merge!(:file => ru, :optparse => op)
 
     # always called after config file parsing, may be called after forking
     lambda do ||
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index 3933da1..059f040 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
@@ -458,7 +458,9 @@ class Unicorn::HttpServer
 
   def after_fork_internal
     @ready_pipe.close if @ready_pipe
-    @ready_pipe = nil
+    Unicorn::Configurator::RACKUP.clear
+    @ready_pipe = @init_listeners = @config = @before_exec = @before_fork = nil
+
     srand # http://redmine.ruby-lang.org/issues/4338
 
     # The OpenSSL PRNG is seeded with only the pid, and apps with frequently