Hoopla!

now with extra whiz-bang!

Hoopla!

Rails-optimized dispatch.fcgi

May 28, 2006 · 1 comment

After seeing Dreamhost killoff my fastcgi processes I’ve modified my dispatch.fcgi file in accordance with the suggestion on the dreamhost wiki. This is fully functional and you can (probably) just copy and past straight into your dispatch.fcgi file. The contents of the file are mostly just comments anyway, so this significantly simplified my dispatch file. Enough ado, here’s the code:

require File.dirname(__FILE__) + "/../config/environment" 
require 'fcgi_handler'

class RailsFCGIHandler
  private
  def fix_handler(signal)
    dispatcher_log :info, "asked to terminate immediately" 
    dispatcher_log :info, "fix handler working its magic!" 
    restart_handler(signal)
  end
  alias_method :exit_now_handler, :fix_handler
end

RailsFCGIHandler.process! nil, 10

→ 1 comment Tags: