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.6 required=5.0 tests=AWL,FREEMAIL_FROM, MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD,T_DKIM_INVALID shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Lawrence Pit Newsgroups: gmane.comp.lang.ruby.unicorn.general Subject: Re: Memcache reset on rails 2.3 with preload Date: Fri, 11 Mar 2011 09:01:24 +1100 Message-ID: <4D794A34.4090900@gmail.com> References: <4D790788.8010305@mrtech.ru> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1299796015 12231 80.91.229.12 (10 Mar 2011 22:26:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 10 Mar 2011 22:26:55 +0000 (UTC) Cc: Troex Nevelin To: unicorn list Original-X-From: mongrel-unicorn-bounces@rubyforge.org Thu Mar 10 23:26:47 2011 Return-path: Envelope-to: gclrug-mongrel-unicorn@m.gmane.org X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=qPkOWmaaJDOiFAEx1rXyBzCbXJSS01eMwOumKC0SnHI=; b=SIZ/u0j7rXCpiQEihwipwrLPbxlSNlOgK+kCWUpSozyi1o3Q20sjU+30jefW5VwHlX 6jOZS5H3wnLmYZ0XkpQis9BaljRZPj4uU30WZyWI5YFq0Zdo4eDr0CMpga67+KRS3irO LDSp4zqE6RXROZhiRj3QKWAhaERjwu1lp0shw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=nQLqnSCS25LBjQvCGzxLmzScrrWKH9JnMmeqEFOMQPDIOh9u9na6vY0M3h2SzLsJO9 az0u5ES4MbNxHZZsMld0DFz8zR4nEafGcWjz8zKxEanyVF2Yqqfr3jT9TSyAmJEpfWcJ BFwQCyvExAmJFjQ0/7dGmAn1pwSOZSGLamk+k= User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 In-Reply-To: <4D790788.8010305@mrtech.ru> 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:877 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PxoJd-0004cO-BC for gclrug-mongrel-unicorn@m.gmane.org; Thu, 10 Mar 2011 23:26:41 +0100 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 70DEA1D780FC; Thu, 10 Mar 2011 17:26:40 -0500 (EST) Received: from mail-gw0-f50.google.com (mail-gw0-f50.google.com [74.125.83.50]) by rubyforge.org (Postfix) with ESMTP id F2A29185835A for ; Thu, 10 Mar 2011 17:01:30 -0500 (EST) Received: by gwj16 with SMTP id 16so783582gwj.23 for ; Thu, 10 Mar 2011 14:01:30 -0800 (PST) Received: by 10.236.77.199 with SMTP id d47mr1805990yhe.144.1299794490609; Thu, 10 Mar 2011 14:01:30 -0800 (PST) Received: from copa.local (124-168-160-97.dyn.iinet.net.au [124.168.160.97]) by mx.google.com with ESMTPS id o25sm2412624yho.16.2011.03.10.14.01.27 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 10 Mar 2011 14:01:28 -0800 (PST) I use: if Rails.cache.is_a?(ActiveSupport::Cache::MemCacheStore) Rails.cache.instance_variable_get(:@data).reset end Cheers, Lawrence > What is a right code for resetting memcache connection in after_fork > for Rails 2.3 with "preload_app true" on REE? > > The only configurations about memcache in my app are: > > config/initializers/session_store.rb: > ActionController::Base.session_store = :mem_cache_store > > config/environment.rb: > config.cache_store = :mem_cache_store > > > I tried: > Rails.cache.reset > > But it fails to start, looks like this code is for Rails3 only > _______________________________________________ > 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 > _______________________________________________ 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