mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-13 16:07:30 +00:00
Bring back cleanup thread
This commit is contained in:
+2
-2
@@ -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:
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user