Skip to content

Commit

Permalink
Remove unused download_database function
Browse files Browse the repository at this point in the history
  • Loading branch information
Lekuruu committed Apr 20, 2024
1 parent 5a5a1a1 commit 4c61c64
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions helpers/external/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ class Geolocation:
timezone: str = 'UTC'
city: str = 'Unknown'

def download_database():
app.session.logger.info('Downloading geolite database...')

response = app.session.requests.get(config.IP_DATABASE_URL)

if not response.ok:
app.session.logger.error(f'Download failed. ({response.status_code})')
app.session.logger.warning('Skipping...')
return

with open(f'{config.DATA_PATH}/geolite.mmdb', 'wb') as f:
f.write(response.content)

@cache
def fetch_geolocation(ip: str) -> Geolocation:
try:
Expand Down

0 comments on commit 4c61c64

Please sign in to comment.