Created
August 28, 2015 17:45
-
-
Save davinmsu/32ba7638d99434b2383c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| GC.copy_on_write_friendly = true if GC.respond_to? :copy_on_write_friendly= | |
| before_exec do |_| | |
| ENV['BUNDLE_GEMFILE'] = "#{@dir}/Gemfile" | |
| end | |
| before_fork do |server, _| | |
| old_pid = "#{server.config[:pid]}.oldbin" | |
| if File.exist?(old_pid) && server.pid != old_pid | |
| begin | |
| Process.kill('QUIT', File.read(old_pid).to_i) | |
| rescue Errno::ENOENT, Errno::ESRCH | |
| end | |
| end | |
| end | |
| after_fork do |_, _| | |
| Rails.cache.reset if Rails.cache.respond_to? :reset | |
| defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment