Merge pull request #8917 from tchak/bump-api-geo-cache
chore(api-geo): bump cache keys
This commit is contained in:
commit
7c4ae3b786
1 changed files with 2 additions and 2 deletions
|
@ -79,7 +79,7 @@ class APIGeoService
|
||||||
private
|
private
|
||||||
|
|
||||||
def communes_by_postal_code_map
|
def communes_by_postal_code_map
|
||||||
Rails.cache.fetch('api_geo_communes', expires_in: 1.week) do
|
Rails.cache.fetch('api_geo_communes_v2', expires_in: 1.week) do
|
||||||
departements
|
departements
|
||||||
.filter { _1[:code] != '99' }
|
.filter { _1[:code] != '99' }
|
||||||
.flat_map { communes(_1[:code]) }
|
.flat_map { communes(_1[:code]) }
|
||||||
|
@ -88,7 +88,7 @@ class APIGeoService
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_from_api_geo(scope)
|
def get_from_api_geo(scope)
|
||||||
Rails.cache.fetch("api_geo_#{scope}", expires_in: 1.week) do
|
Rails.cache.fetch("api_geo_#{scope}_v2", expires_in: 1.week) do
|
||||||
JSON.parse(Rails.root.join('lib', 'data', 'api_geo', "#{scope}.json").read, symbolize_names: true)
|
JSON.parse(Rails.root.join('lib', 'data', 'api_geo', "#{scope}.json").read, symbolize_names: true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue