--bcaec54861005ef6c804b0fdaa14
Content-Type: text/plain; charset=UTF-8
Hi,
I would like to run a Rack application, that can be buggy, and
sometimes throws an exception. I want to catch it, and force
my whole Rack app to continue running. This is the schema:
app ..a Rack app definition goes here...
require 'rack'
begin
Rack::Handler::FastCGI.run app, :Port 9811
rescue Exception e
$stderr.puts "...print info about the exception #{e}..."
retry
end
This way I can catch the exception, but when the retry is reached the
Rack::Handler::FastCGI line again, it fails because of the port 9811
is already in use.
How can I close that port (stop Rack server thread?), and tell Rack
to reopen it?
u.
--bcaec54861005ef6c804b0fdaa14--