From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS14383 205.234.109.0/24 X-Spam-Status: No, score=-0.5 required=5.0 tests=AWL,MSGID_FROM_MTA_HEADER, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.unicorn.general Subject: Re: 'before_fork' is =?iso-8859-1?Q?execut?= =?iso-8859-1?Q?ed_in_parallel_by_two_processes_=BF=3F?= Date: Tue, 5 Jan 2010 15:55:52 -0800 Message-ID: <20100105235552.GA6027@dcvr.yhbt.net> References: <201001051144.42394.ibc@aliax.net> <201001052349.43567.ibc@aliax.net> <20100105225752.GA3377@dcvr.yhbt.net> <201001060030.49486.ibc@aliax.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1262735763 13989 80.91.229.12 (5 Jan 2010 23:56:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Jan 2010 23:56:03 +0000 (UTC) To: unicorn list Original-X-From: mongrel-unicorn-bounces@rubyforge.org Wed Jan 06 00:55:56 2010 Return-path: Envelope-to: gclrug-mongrel-unicorn@m.gmane.org X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org Content-Disposition: inline In-Reply-To: <201001060030.49486.ibc@aliax.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: mongrel-unicorn@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org Xref: news.gmane.org gmane.comp.lang.ruby.unicorn.general:313 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.50) id 1NSJFi-00076S-MX for gclrug-mongrel-unicorn@m.gmane.org; Wed, 06 Jan 2010 00:55:54 +0100 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 0A7B518582C7; Tue, 5 Jan 2010 18:55:55 -0500 (EST) Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by rubyforge.org (Postfix) with ESMTP id 46167185826F for ; Tue, 5 Jan 2010 18:55:53 -0500 (EST) Received: from localhost (unknown [127.0.2.5]) by dcvr.yhbt.net (Postfix) with ESMTP id C7B461F4E5; Tue, 5 Jan 2010 23:55:52 +0000 (UTC) I=F1aki Baz Castillo wrote: > El Martes, 5 de Enero de 2010, Eric Wong escribi=F3: > = > > 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 workarou= nd = > that works for me). You can also do it on a certain worker only: before_fork do |server, worker| if worker.nr =3D=3D 0 ... end end -- = Eric Wong _______________________________________________ Unicorn mailing list - mongrel-unicorn@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying