From c349dc2f17bd9783d70c3a8165201e5a8fe0d538 Mon Sep 17 00:00:00 2001 From: Gregory Danielson Date: Sun, 15 Nov 2020 11:02:12 -0600 Subject: [PATCH] Break from IPLOCATION method loop if one method produces non-null result --- lib/location.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/location.py b/lib/location.py index b6acab9..1c968bc 100644 --- a/lib/location.py +++ b/lib/location.py @@ -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)