Bring back cleanup thread

This commit is contained in:
Ian Renton
2026-08-13 07:13:05 +01:00
parent c913d0bac8
commit d1a9af9932
10 changed files with 20 additions and 17 deletions
+2 -2
View File
@@ -43,7 +43,7 @@ class CleanupTimer:
try:
for i in list(DATA_STORE.spots.keys()):
try:
spot = DATA_STORE.spots[i]
spot = DATA_STORE.spots.get(i)
if spot.expired():
DATA_STORE.spots.delete(i)
except KeyError:
@@ -51,7 +51,7 @@ class CleanupTimer:
pass
for i in list(DATA_STORE.alerts.keys()):
try:
alert = DATA_STORE.alerts[i]
alert = DATA_STORE.alerts.get(i)
if alert.expired():
DATA_STORE.alerts.delete(i)
except KeyError:
+3
View File
@@ -103,6 +103,9 @@ class DataStore:
self.dxcc_lookup_by_call_regex.append((re.compile(entry["prefixRegex"]), entry["entityCode"]))
def close(self):
self.spots.save_snapshot()
self.alerts.save_snapshot()
self.spots.close()
self.alerts.close()
self._solar.close()