mirror of
https://github.com/chubin/wttr.in.git
synced 2024-10-05 01:42:07 +02:00
Check ipcache before fetching from geoip
This commit is contained in:
parent
0056a97386
commit
af9658f63b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user