Forcing FCGI headers

In my Rails application, I have this one function that reads a list of
webpages and parses their contents. It takes about a minutes to
complete.

My FastCGI times out at 30 seconds and stops the application
[error] [client 10.4.114.211] FastCGI: comm with (dynamic) server
"C:/crawler/public/dispatch.fcgi" aborted: (first read) idle timeout (30
sec), referer: http://tor105850/trackers/

Though the function goes on to finish updating the database.

So my question is -- how would I set up my Rails controller to function
in the following manner

  Render 'updating, please wait'
  Function()
  Render 'done'

Without having FastCGI time out on me?

Thank you,
--Tony

Without having FastCGI time out on me?

Basically, there's no way to do this that I know of. What you can do, though, is to simply increase the FastCGI timeout. The default is a meager 30 seconds. Way too low for a bunch of applications, including Basecamp. We use 600 seconds (to allow for file uploads which are shuttled on to the users on FTP server).

Alternatively, you can have your action trigger an external service of some sorts that complete the computation asynchronously. Then you could have some other way of alerting the users, like using Ajax (and specifically periodically_call_remote which is in beta gems/SVN) to check the status of the operation and report success when its done.

···

--
David Heinemeier Hansson,
http://www.basecamphq.com/ -- Web-based Project Management
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://www.loudthinking.com/ -- Broadcasting Brain