Skip to content

Instantly share code, notes, and snippets.

@jfernandez
Created April 15, 2010 06:36
Show Gist options
  • Save jfernandez/366768 to your computer and use it in GitHub Desktop.
Save jfernandez/366768 to your computer and use it in GitHub Desktop.
if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do |forked|
if forked
# Rails cache_store
Rails.cache.instance_variable_get(:@data).reset if Rails.cache.class == ActiveSupport::Cache::MemCacheStore
# Reset the session_store, value could be nil depending on how you set it up
ActionController::Base.session_options[:cache].reset
# Reset the cache_fu connection (if used)
CACHE.reset if defined?(CACHE)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment