Memcache reset on rails 2.3 with preload

Lawrence Pit lawrence.pit at gmail.com
Thu Mar 10 17:01:24 EST 2011


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 at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-unicorn
> Do not quote signatures (like this one) or top post when replying
>



More information about the mongrel-unicorn mailing list