Further alert implementation #17

This commit is contained in:
Ian Renton
2025-10-06 17:14:52 +01:00
parent fdb2a445b8
commit e0675a01f0
7 changed files with 280 additions and 22 deletions

View File

@@ -10,8 +10,9 @@ import pytz
class CleanupTimer:
# Constructor
def __init__(self, spots, cleanup_interval):
def __init__(self, spots, alerts, cleanup_interval):
self.spots = spots
self.alerts = alerts
self.cleanup_interval = cleanup_interval
self.cleanup_timer = None
self.last_cleanup_time = datetime.min.replace(tzinfo=pytz.UTC)
@@ -30,6 +31,7 @@ class CleanupTimer:
try:
# Perform cleanup
self.spots.expire()
self.alerts.expire()
self.status = "OK"
self.last_cleanup_time = datetime.now(pytz.UTC)