Skip to content

Instantly share code, notes, and snippets.

@stve
Created June 30, 2010 19:05
Show Gist options
  • Save stve/459083 to your computer and use it in GitHub Desktop.
Save stve/459083 to your computer and use it in GitHub Desktop.
if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do |forked|
if forked
# We're in smart spawning mode.
Member.connection.reconnect!
Rails.cache.instance_variable_get(:@cache).quit if Rails.cache.class == ActiveSupport::Cache::LibmemcachedStore
else
# We're in conservative spawning mode. We don't need to do anything.
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment