Heroku makes it easy to spin up a free new Rails application. The hard part is keeping it free! Here are a few tips and tricks to help you keep Heroku free for as long as possible.
preload_app true ! before_fork do |server, worker| Signal.trap "TERM" do puts "Unicorn master receiving TERM and sending QUIT instead" Process.kill "QUIT", Process.pid end ! if defined? ActiveRecord::Base ActiveRecord::Base.connection.disconnect! end end ! after_fork do |server, worker| Signal.trap "TERM" do puts "Unicorn worker receiving TERM but waiting for master to send QUIT" end ! if defined? ActiveRecord::Base ActiveRecord::Base.establish_connection end end