various fixes
This commit is contained in:
parent
551f96197c
commit
6ccf25b347
7 changed files with 13 additions and 7 deletions
|
@ -1,4 +1,5 @@
|
|||
class AmfController < ApplicationController
|
||||
=begin
|
||||
require 'stringio'
|
||||
|
||||
# to log:
|
||||
|
@ -610,5 +611,5 @@ class AmfController < ApplicationController
|
|||
180/Math::PI * (2*Math.atan(Math.exp(a*Math::PI/180))-Math::PI/2)
|
||||
end
|
||||
|
||||
|
||||
=end
|
||||
end
|
||||
|
|
|
@ -18,6 +18,7 @@ class ApiController < ApplicationController
|
|||
|
||||
def map
|
||||
@@count+=1
|
||||
|
||||
response.headers["Content-Type"] = 'text/xml'
|
||||
# Figure out the bbox
|
||||
bbox = params['bbox']
|
||||
|
@ -103,14 +104,14 @@ class ApiController < ApplicationController
|
|||
doc.root << way.to_xml_node()
|
||||
end
|
||||
|
||||
render :text => doc.to_s
|
||||
|
||||
#exit when we have too many requests
|
||||
if @@count > MAX_COUNT
|
||||
render :text => doc.to_s
|
||||
@@count = COUNT
|
||||
exit
|
||||
exit!
|
||||
end
|
||||
|
||||
render :text => doc.to_s
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -107,7 +107,7 @@ class TraceController < ApplicationController
|
|||
@trace.timestamp = Time.now
|
||||
|
||||
if @trace.save
|
||||
saved_filename = "/tmp/#{@trace.id}.gpx"
|
||||
saved_filename = "/home/osm/gpx/#{@trace.id}.gpx"
|
||||
File.rename(filename, saved_filename)
|
||||
|
||||
logger.info("id is #{@trace.id}")
|
||||
|
|
|
@ -85,7 +85,7 @@ class Node < ActiveRecord::Base
|
|||
el1['lon'] = self.longitude.to_s
|
||||
|
||||
# el['user'] = self.user.display_name if self.user.data_public?
|
||||
|
||||
user_display_name_cache = {} if user_display_name_cache.nil?
|
||||
if user_display_name_cache and user_display_name_cache[self.user_id]
|
||||
# use the cache if available
|
||||
else
|
||||
|
|
|
@ -78,6 +78,8 @@ class Segment < ActiveRecord::Base
|
|||
el1['id'] = self.id.to_s
|
||||
el1['from'] = self.node_a.to_s
|
||||
el1['to'] = self.node_b.to_s
|
||||
|
||||
user_display_name_cache = {} if user_display_name_cache.nil?
|
||||
if user_display_name_cache and user_display_name_cache[self.user_id]
|
||||
# use the cache if available
|
||||
else
|
||||
|
|
|
@ -56,6 +56,8 @@ class Way < ActiveRecord::Base
|
|||
el1['visible'] = self.visible.to_s
|
||||
el1['timestamp'] = self.timestamp.xmlschema
|
||||
|
||||
user_display_name_cache = {} if user_display_name_cache.nil?
|
||||
|
||||
if user_display_name_cache and user_display_name_cache[self.user_id]
|
||||
# use the cache if available
|
||||
else
|
||||
|
|
|
@ -77,4 +77,4 @@ HTTP_EXPECTATION_FAILED = 417
|
|||
#Taming FCGI
|
||||
#
|
||||
COUNT = 0
|
||||
MAX_COUNT = 500
|
||||
MAX_COUNT = 10
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue