diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-04-13 11:46:14 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-04-13 12:01:20 -0700 |
commit | f34618e64b254f7792b476acf2e7eb426aa551a2 (patch) | |
tree | 4d3e6ee0358e53667f1b512cb930afe4cd9d5911 /lib/unicorn.rb | |
parent | a9d022298c194edf296d6d19ff97c8b8a6ce4839 (diff) | |
download | unicorn-f34618e64b254f7792b476acf2e7eb426aa551a2.tar.gz |
Instead of just worker.nr. This is a configuration file/API change and will break existing configurations. This allows worker.tempfile to be exposed to the hooks so ownership changes can still happen on it. On the other hand, I don't know of many people actually using this feature (or Unicorn).
Diffstat (limited to 'lib/unicorn.rb')
-rw-r--r-- | lib/unicorn.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb index c1e8fcd..4465109 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -389,7 +389,7 @@ module Unicorn tempfile = Tempfile.new('') # as short as possible to save dir space tempfile.unlink # don't allow other processes to find or see it worker = Worker.new(worker_nr, tempfile) - @before_fork.call(self, worker.nr) + @before_fork.call(self, worker) pid = fork { worker_loop(worker) } @workers[pid] = worker end @@ -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.nr) if @after_fork # can drop perms + @after_fork.call(self, worker) if @after_fork # can drop perms @request = HttpRequest.new(logger) build_app! unless @preload_app end |