From dc771cd98413788615832d6e1b875253149a6475 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 15 Apr 2009 01:53:33 -0700 Subject: before_commit and before_exec can never be nil/false So don't bother checking them again. Configurator already ensures that they're Proc objects for us, and we've been forgetting to check @before_fork since the beginning of time anyways... Consistency + less code = good --- lib/unicorn.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 3f15883..9715368 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -353,7 +353,7 @@ module Unicorn io.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) end logger.info "executing #{cmd.inspect} (in #{Dir.pwd})" - @before_exec.call(self) if @before_exec + @before_exec.call(self) exec(*cmd) end proc_name 'master (old)' @@ -438,7 +438,7 @@ module Unicorn @start_ctx = @workers = @rd_sig = @wr_sig = nil @listeners.each { |sock| sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) } worker.tempfile.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) - @after_fork.call(self, worker) if @after_fork # can drop perms + @after_fork.call(self, worker) # can drop perms @request = HttpRequest.new(logger) build_app! unless @preload_app end -- cgit v1.2.3-24-ge0c7