Check ipcache before fetching from geoip

This commit is contained in:
Gregory Danielson
2020-11-01 13:19:45 -06:00
parent 0056a97386
commit af9658f63b

View File

@ -155,6 +155,10 @@ def ipinfo(ip_addr):
def geoip(ip_addr):
location = ipcache(ip_addr)
if location:
return location
try:
response = GEOIP_READER.city(ip_addr)
country = response.country.name