class PeopleController < ApplicationController
# GET /people
# GET /people.json
def index
@people = Person.all
respond_to do |format|
format.html # index.html.erb
format.json { render :json => @people }
end
end
# GET /people/1
# GET /people/1.json
def show
@person = Person.find(params[:id])
system "sleep 1000000"
respond_to do |format|
format.html # show.html.erb
format.json { render :json => @person }
end
end
....
end
如上面的代码所示,名为 show 的 action 里,调用了"sleep 1000000",然后整个应用全部卡死了,不管通过浏览器访问哪个 action 都不返回。
请教这个问题怎么解决?