dawarich/config/initializers/geocoder.rb
2024-08-14 18:06:37 +02:00

18 lines
303 B
Ruby

# frozen_string_literal: true
settings = {
timeout: 5,
units: :km,
cache: Redis.new,
always_raise: :all,
cache_options: {
expiration: 1.day
}
}
if defined?(PHOTON_API_HOST)
settings[:lookup] = :photon
settings[:photon] = { host: PHOTON_API_HOST }
end
Geocoder.configure(settings)