Iñaki Baz Castillo <[email protected]> wrote:
> El Martes, 5 de Enero de 2010, Eric Wong escribió:
> 
> > Yes, before_fork and after_fork are both called for every worker forked.
> 
> So if I just want to test a DB connection then I do better wrtitting such 
> code 
> out of before_fork in the config file, right? (at least it's the workaround 
> that works for me).

You can also do it on a certain worker only:

  before_fork do |server, worker|
    if worker.nr == 0
      ...
    end
  end

-- 
Eric Wong
_______________________________________________
Unicorn mailing list - [email protected]
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying

Reply via email to