From: Tom Hughes Date: Sun, 26 Apr 2009 23:14:20 +0000 (+0000) Subject: Remove old code to exit after 10000 requests as the memory limit code X-Git-Tag: live~8086 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/72b05157ae4d59177cd2fb667c42328b203374f1 Remove old code to exit after 10000 requests as the memory limit code should do a better job of controlling things. --- diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index ca4cbcbd7..855e05888 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -7,9 +7,6 @@ class ApiController < ApplicationController # Help methods for checking boundary sanity and area size include MapBoundary - #COUNT is the number of map requests to allow before exiting and starting a new process - @@count = COUNT - # The maximum area you're allowed to request, in square degrees MAX_REQUEST_AREA = APP_CONFIG['max_request_area'] @@ -73,13 +70,6 @@ class ApiController < ApplicationController trkseg << point.to_xml_node() end - #exit when we have too many requests - if @@count > MAX_COUNT - render :text => doc.to_s, :content_type => "text/xml" - @@count = COUNT - exit! - end - response.headers["Content-Disposition"] = "attachment; filename=\"map.osm\"" render :text => doc.to_s, :content_type => "text/xml" @@ -206,13 +196,6 @@ class ApiController < ApplicationController response.headers["Content-Disposition"] = "attachment; filename=\"map.osm\"" render :text => doc.to_s, :content_type => "text/xml" - - #exit when we have too many requests - if @@count > MAX_COUNT - @@count = COUNT - - exit! - end end # Get a list of the tiles that have changed within a specified time diff --git a/config/initializers/limits.rb b/config/initializers/limits.rb index 1ce493dfb..9862036f7 100644 --- a/config/initializers/limits.rb +++ b/config/initializers/limits.rb @@ -2,7 +2,3 @@ if Process.const_defined?(:RLIMIT_AS) Process.setrlimit Process::RLIMIT_AS, 1024*1024*1024, Process::RLIM_INFINITY end - -# Force a restart after every 10000 requests -COUNT = 0 -MAX_COUNT = 10000