mirror of
https://github.com/chubin/wttr.in
synced 2025-01-26 10:45:01 +00:00
Break from IPLOCATION method loop if one method produces non-null result
This commit is contained in:
parent
34313eb162
commit
c349dc2f17
1 changed files with 2 additions and 0 deletions
|
@ -196,6 +196,8 @@ def get_location(ip_addr):
|
|||
location = ipinfo(ip_addr)
|
||||
else:
|
||||
print("ERROR: invalid iplocation method specified: %s" % method)
|
||||
if location is not None:
|
||||
break
|
||||
|
||||
if location is not None and all(location):
|
||||
ipcachewrite(ip_addr, location)
|
||||
|
|
Loading…
Reference in a new issue