diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-04-10 00:32:40 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-04-10 10:10:56 -0700 |
commit | 0e59330750559e2cb8f81d9568c2100bd5c6aaec (patch) | |
tree | 7224505a2a0b37f932386d894ed5e046eda9e4cf /lib | |
parent | e83756512c44294137ee3362cf131eed70663fb1 (diff) | |
download | unicorn-0e59330750559e2cb8f81d9568c2100bd5c6aaec.tar.gz |
Rather than blindly appending to our listener set with every "listen" directive read in the config file, reset our internal array. Listeners specified on the command-line are always preserved between config reloads.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unicorn.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 6b50319..02419e7 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -59,6 +59,7 @@ module Unicorn @io_purgatory = [] # prevents IO objects in here from being GC-ed @request = @rd_sig = @wr_sig = nil @reexec_pid = 0 + @init_listeners = options[:listeners] ? options[:listeners].dup : [] @config = Configurator.new(options.merge(:use_defaults => true)) @listener_opts = {} @config.commit!(self, :skip => [:listeners, :pid]) @@ -570,6 +571,7 @@ module Unicorn def load_config! begin logger.info "reloading config_file=#{@config.config_file}" + @config[:listeners].replace(@init_listeners) @config.reload @config.commit!(self) kill_each_worker(:QUIT) |