-
-
Save whalesalad/24a83207a96f52b85605 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
worker_processes 4 | |
preload_app true | |
before_fork do |server, worker| | |
defined?(ActiveRecord::Base) and | |
ActiveRecord::Base.connection.disconnect! | |
end | |
after_fork do |server, worker| | |
defined?(ActiveRecord::Base) and | |
ActiveRecord::Base.establish_connection | |
defined?(AnalyticsRuby) and | |
Analytics.init( | |
secret: Rails.configuration.segment_io_secret, | |
on_error: Rails.configuration.segment_io_error | |
) | |
end | |
# Nuke workers if they take too long to respond to requestz | |
timeout 20 | |
listen ENV['PORT'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment