Created
February 18, 2013 22:30
-
-
Save kitop/4981364 to your computer and use it in GitHub Desktop.
Unicorn config example
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
# config/unicorn.rb | |
worker_processes 4 | |
timeout 30 | |
preload_app true | |
before_fork do |server, worker| | |
# Replace with your ORM of choice | |
if defined?(ActiveRecord::Base) | |
ActiveRecord::Base.connection.disconnect! | |
end | |
# Replace with your Background Worker of choice or any other configuration | |
if defined?(Resque) | |
Resque.redis.quit | |
end | |
end | |
after_fork do |server, worker| | |
# Replace with your ORM of choice | |
if defined?(ActiveRecord::Base) | |
ActiveRecord::Base.establish_connection | |
end | |
# Replace with your Background Worker of choice or any other configuration | |
if defined?(Resque) | |
Resque.redis = ENV['REDISTOGO_URL'] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment