Skip to content

Instantly share code, notes, and snippets.

@jkndrkn
Created April 28, 2011 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkndrkn/947243 to your computer and use it in GitHub Desktop.
Save jkndrkn/947243 to your computer and use it in GitHub Desktop.
before_fork do
logger.formatter = Logger::Formatter.new
logger.info "Loading application..."
require(root_path + 'config/environment.rb')
Dir.chdir(RAILS_ROOT)
logger.info "Loading brain for DecisionPoint 'Insti', 'LMP'..."
Appraiser["LMP_Insti"]
ActiveRecord::Base.remove_connection
GC.copy_on_write_friendly = true if USING_REE
GC.disable
end
after_fork do
Kernel.srand(Process.pid)
ActiveRecord::Base.establish_connection
$0 = $0 + " " + Rails.env
NewRelic::Agent.manual_start :agent_enabled => true
en
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment