Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# ...
if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do |forked|
if forked
Rails.cache.instance_variable_get(:@data).reset if Rails.cache.class == ActiveSupport::Cache::MemCacheStore
ActionController::Base.session_options[:cache].reset
end
end
end
# ...
@madsheep

This comment has been minimized.

Copy link

commented Mar 2, 2011

I know this is an old one, but any ideas how to do it on RoR3?

@agibralter

This comment has been minimized.

Copy link
Owner Author

commented Mar 2, 2011

Hmm I'm not too sure of the specific syntax for Rails 3... but I'm sure the idea is similar.

https://github.com/rails/rails/blob/v3.0.5/actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb
https://github.com/rails/rails/blob/v3.0.5/activesupport/lib/active_support/cache.rb

As for where to put it... perhaps in an config/initializers?

Sorry... I haven't upgraded to Rails 3 yet...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.