rails:hosting=dreamhost && rails:application_server=fastcgi
3 Feb 07Los que tengáis alguna aplicación Rails funcionando en Dreamhost posiblemente tengáis el FastCGI modificado para evitar los repentinos errores 500.
Hoy, sin embargo, he encontrado un plugin que lo sofistica aún un poquito más.
Si no os queréis bajar el plugin podéis modificar vuestro dispatch.fcgi añadiendo las siguientes líneas:
require 'fcgi_handler'
class RailsFCGIHandler
# Dreamhost: changes TERM signal handling so your site isn't
# killed while handling a request
private
def busy_exit_handler(signal)
dispatcher_log :info, "busy: asked to terminate during \
request signal #{signal}, deferring!"
@when_ready = :exit
end
def term_process_request(cgi)
install_signal_handler('TERM',
method(:busy_exit_handler).to_proc)
Dispatcher.dispatch(cgi)
rescue Exception => e
raise if SignalException === e
dispatcher_error(e)
ensure
install_signal_handler('TERM',
method(:exit_now_handler).to_proc)
end
alias_method :process_request, :term_process_request
end
Nota: el título del post es un homenaje a las machine tags de flickr, que tan bien han comentado mis compañeros: manuel, limalimon y otra vez manuel.

1 comentario