Rails中Google Maps Geocoding API响应过慢问题求助
演示环境Google Maps API响应过慢排查求助
遇到如下问题,盼协助调试:
- 演示环境调用Google Maps API时响应过慢,但生产环境运行正常,两者配置完全一致
- 已将timeout设置为15秒,问题仍未解决
- 尝试将ip_lookup从freegeoip更换为其他服务,无效果
附上config/initializers/geocoder.rb的配置代码,需要更多信息请告知:
Geocoder.configure( # geocoding options timeout: 15, # geocoding service timeout (secs) lookup: :google, # name of geocoding service (symbol) # :language => :en, # ISO-639 language code # :use_https => false, # use HTTPS for lookup requests? (if supported) # :http_proxy => nil, # :https_proxy => nil, api_key: APIKEY, cache: Rails.cache, # cache object (must respond to #[], #[]=, and #keys) cache_prefix: 'geocoder:', # prefix (string) to use for all cache keys ip_lookup: :freegeoip, # exceptions that should not be rescued by default # (if you want to implement custom error handling); # supports SocketError and TimeoutError # :always_raise => [], # calculation options units: :km # :km for kilometers or :mi for miles # :distances => :linear # :spherical or :linear )
内容的提问来源于stack exchange,提问作者codingman
相关产品推荐
相关产品推荐

