dawarich/config/initializers/geocoder.rb

19 lines
346 B
Ruby
Raw Normal View History

2024-07-12 15:59:03 -04:00
# frozen_string_literal: true
settings = {
timeout: 5,
units: DISTANCE_UNIT,
cache: Redis.new,
always_raise: :all,
cache_options: {
expiration: 1.day
}
}
if defined?(PHOTON_API_HOST)
settings[:lookup] = :photon
settings[:photon] = { use_https: PHOTON_API_USE_HTTPS, host: PHOTON_API_HOST }
end
Geocoder.configure(settings)