Skip to content

Commit

Permalink
Change geo ip service
Browse files Browse the repository at this point in the history
  • Loading branch information
chubin committed Jan 3, 2024
1 parent 6b05047 commit 01787b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def _geolocator(location):
if random.random() < 0:
geo = requests.get('%s/%s' % (GEOLOCATOR_SERVICE, location)).text
else:
geo = requests.get("http://127.0.0.1:8083/:geo-location?location=%s" % location).text
geo = requests.get("http://127.0.0.1:8085/:geo-location?location=%s" % location).text
except requests.exceptions.ConnectionError as exception:
print("ERROR: %s" % exception)
return None
Expand Down Expand Up @@ -152,7 +152,7 @@ def _ipcache(ip_addr):
"""

## Use Geo IP service when available
r = requests.get("http://127.0.0.1:8083/:geo-ip-get?ip=%s" % ip_addr)
r = requests.get("http://127.0.0.1:8085/:geo-ip-get?ip=%s" % ip_addr)
if r.status_code == 200 and ";" in r.text:
_, country, region, city, *_ = r.text.split(';')
return city, region, country
Expand Down

0 comments on commit 01787b5

Please sign in to comment.