fix: ip-lookup database lazy loading for all environments (#8052)
The current task for loading `GeoLite2-City.mmdb` doesn't work for all build types. This PR addresses this and move the task to initializer to ensure consistency across environments. --------- Co-authored-by: Sojan Jose <sojan@pepalo.com> Co-authored-by: Sojan Jose <sojan.official@gmail.com>
This commit is contained in:
@@ -24,3 +24,7 @@ module GeocoderConfiguration
|
||||
end
|
||||
|
||||
Geocoder.configure(ip_lookup: :geoip2, geoip2: { file: GeocoderConfiguration::LOOK_UP_DB }) if ENV['IP_LOOKUP_API_KEY'].present?
|
||||
|
||||
Rails.application.config.after_initialize do
|
||||
Geocoder::SetupService.new.perform
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user