dawarich/config/initializers/geocoder.rb

19 lines
320 B
Ruby
Raw Normal View History

2024-07-12 15:59:03 -04:00
# frozen_string_literal: true
settings = {
timeout: 5,
2024-08-28 17:54:00 -04:00
units: DISTANCE_UNIT.to_sym,
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)