chore: Add down gem for Local file downloads (#2765)
- Add down gem to handle downloading files to host machine - Remove the LocalResource class - Introduce max limit for contact avatars send via SDK
This commit is contained in:
@@ -45,8 +45,10 @@ class ContactIpLookupJob < ApplicationJob
|
||||
|
||||
def setup_vendor_db
|
||||
base_url = 'https://download.maxmind.com/app/geoip_download'
|
||||
source = URI.parse("#{base_url}?edition_id=GeoLite2-City&suffix=tar.gz&license_key=#{ENV['IP_LOOKUP_API_KEY']}").open
|
||||
tar_extract = Gem::Package::TarReader.new(Zlib::GzipReader.open(source))
|
||||
source_file = Down.download(
|
||||
"#{base_url}?edition_id=GeoLite2-City&suffix=tar.gz&license_key=#{ENV['IP_LOOKUP_API_KEY']}"
|
||||
)
|
||||
tar_extract = Gem::Package::TarReader.new(Zlib::GzipReader.open(source_file))
|
||||
tar_extract.rewind
|
||||
|
||||
tar_extract.each do |entry|
|
||||
|
||||
Reference in New Issue
Block a user