Skip to content

Instantly share code, notes, and snippets.

@freeformz
Created December 31, 2012 20:21
Show Gist options
  • Save freeformz/4422458 to your computer and use it in GitHub Desktop.
Save freeformz/4422458 to your computer and use it in GitHub Desktop.
Unicorn config
#....
before_fork do |server, worker|
defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
end
end
after_fork do |server, worker|
defined?(ActiveRecord::Base) and
ActiveRecord::Base.establish_connection
end
end
#....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment