From ee0088ea9906701f0c89e89ce78acd9d4820ee65 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 10 Jun 2010 21:45:54 +0000 Subject: fix alt-working_directory behavior for Rails 3 --- lib/unicorn/configurator.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb index 0716e64..b1a317e 100644 --- a/lib/unicorn/configurator.rb +++ b/lib/unicorn/configurator.rb @@ -59,6 +59,9 @@ module Unicorn parse_rackup_file + # unicorn_rails creates dirs here after working_directory is bound + after_reload.call if after_reload + # working_directory binds immediately (easier error checking that way), # now ensure any paths we changed are correctly set. [ :pid, :stderr_path, :stdout_path ].each do |var| @@ -67,9 +70,6 @@ module Unicorn File.writable?(path) || File.writable?(File.dirname(path)) or \ raise ArgumentError, "directory for #{var}=#{path} not writable" end - - # unicorn_rails creates dirs here after working_directory is bound - after_reload.call if after_reload end def commit!(server, options = {}) #:nodoc: @@ -456,7 +456,7 @@ module Unicorn if daemonize # unicorn_rails wants a default pid path, (not plain 'unicorn') - if ru == :rails + if after_reload spid = set[:pid] pid('tmp/pids/unicorn.pid') if spid.nil? || spid == :unset end -- cgit v1.2.3-24-ge0c7