Refactor of caching & data storage part 14 #118

This commit is contained in:
Ian Renton
2026-08-03 19:25:25 +01:00
parent 50ab27e4a2
commit f82d611b7e
15 changed files with 144 additions and 142 deletions
+3 -3
View File
@@ -27,11 +27,10 @@ class HamQTH(APIQueryCallsignDataProvider):
# and password, this is valid for an hour, so our cache stores this specifically for 55 minutes.
self._CREDENTIALS_CACHE = CachedSession(CACHE_DIR + "/urls/hamqth-creds",
expire_after=timedelta(minutes=55))
self.status = "Ready"
def _perform_new_lookup(self, callsign, lookup_credentials):
# If we don't have HamQTH credentials, skip this lookup
if not ((lookup_credentials.hamqth_username and lookup_credentials.hamqth_password)
if not lookup_credentials or not ((lookup_credentials.hamqth_username and lookup_credentials.hamqth_password)
or lookup_credentials.hamqth_session_key):
return None
@@ -134,4 +133,5 @@ class HamQTH(APIQueryCallsignDataProvider):
grid=grid,
dxcc_id=int(data["adif"]) if "adif" in data else None,
cq_zone=int(data["cq"]) if "cq" in data else None,
itu_zone=int(data["itu"]) if "itu" in data else None)
itu_zone=int(data["itu"]) if "itu" in data else None,
location_source="HOME QTH")