Created
November 1, 2011 21:14
-
-
Save travisp/1331933 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c/environment.rb | |
# Load the rails application | |
require File.expand_path('../application', __FILE__) | |
# Initialize the rails application | |
Mokabla::Application.initialize! | |
if defined?(PhusionPassenger) && !Rails.env.development? | |
PhusionPassenger.on_event(:starting_worker_process) do |forked| | |
# Reset Rails's object cache | |
# Only works with DalliStore | |
Rails.cache.reset if forked | |
# Reset Rails's session store | |
# If you know a cleaner way to find the session store instance, please let me know | |
ObjectSpace.each_object(ActionDispatch::Session::DalliStore) { |obj| obj.reset } | |
end | |
end | |
~ | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment