Merge pull request #9688 from colinux/fix-geocoder-redis-cache
Geocoder: ensure to use exact rails redis cache configuration
This commit is contained in:
commit
ae675fac2a
1 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
cache_configuration = if ENV['REDIS_CACHE_URL'].present?
|
cache_configuration = if Rails.cache.respond_to?(:redis)
|
||||||
{ cache: Redis.new(url: ENV['REDIS_CACHE_URL']), cache_options: { prefix: "geocoder:", expiration: 6.hours } }
|
{ cache: Rails.cache.redis, cache_options: { prefix: "geocoder:", expiration: 6.hours } }
|
||||||
else
|
else
|
||||||
{ cache: Geocoder::CacheStore::Generic.new(Rails.cache, { prefix: "geocoder:" }) } # generic has no specific expiration support as of geocoder 1.8
|
{ cache: Geocoder::CacheStore::Generic.new(Rails.cache, { prefix: "geocoder:" }) } # generic uses default Rails.cache expiration as of geocoder 1.8
|
||||||
end
|
end
|
||||||
|
|
||||||
Geocoder.configure(lookup: :ban_data_gouv_fr, use_https: true, **cache_configuration)
|
Geocoder.configure(lookup: :ban_data_gouv_fr, use_https: true, **cache_configuration)
|
||||||
|
|
Loading…
Reference in a new issue