X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/51e0cf85b0b44c32b0cb097e046eafed7f7f14be..ed74bc036b3203bb14c3fbb986c077f2958d004d:/app/controllers/application_controller.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8290a027e..fdc2ac4e8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -224,14 +224,17 @@ class ApplicationController < ActionController::Base if e.is_a?(Timeout::Error) || (e.is_a?(ActiveRecord::StatementInvalid) && e.message.include?("execution expired")) - ActiveRecord::Base.connection.raw_connection.cancel - render :action => "timeout" + respond_to_timeout else raise end rescue Timeout::Error + respond_to_timeout + end + + def respond_to_timeout ActiveRecord::Base.connection.raw_connection.cancel - render :action => "timeout" + render :action => "timeout", :status => :gateway_timeout end ##