2024-07-12 15:59:03 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2024-08-14 12:06:37 -04:00
|
|
|
settings = {
|
|
|
|
|
timeout: 5,
|
2024-10-02 15:29:56 -04:00
|
|
|
units: DISTANCE_UNIT,
|
2024-03-17 13:16:45 -04:00
|
|
|
cache: Redis.new,
|
2024-08-14 12:06:37 -04:00
|
|
|
always_raise: :all,
|
2024-10-19 12:39:01 -04:00
|
|
|
use_https: PHOTON_API_USE_HTTPS,
|
2024-03-17 13:16:45 -04:00
|
|
|
cache_options: {
|
2024-08-14 12:06:37 -04:00
|
|
|
expiration: 1.day
|
2024-03-17 13:16:45 -04:00
|
|
|
}
|
2024-08-14 12:06:37 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if defined?(PHOTON_API_HOST)
|
|
|
|
|
settings[:lookup] = :photon
|
2024-10-17 18:32:16 -04:00
|
|
|
settings[:photon] = { use_https: PHOTON_API_USE_HTTPS, host: PHOTON_API_HOST }
|
2024-08-14 12:06:37 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
Geocoder.configure(settings)
|