First attempt at SSE backend #3

This commit is contained in:
Ian Renton
2025-12-22 12:04:35 +00:00
parent 968576f74c
commit c95c6bb347
7 changed files with 427 additions and 148 deletions

View File

@@ -10,9 +10,10 @@ import pytz
class CleanupTimer:
# Constructor
def __init__(self, spots, alerts, cleanup_interval):
def __init__(self, spots, alerts, web_server, cleanup_interval):
self.spots = spots
self.alerts = alerts
self.web_server = web_server
self.cleanup_interval = cleanup_interval
self.cleanup_timer = None
self.last_cleanup_time = datetime.min.replace(tzinfo=pytz.UTC)
@@ -51,6 +52,9 @@ class CleanupTimer:
# Must have already been deleted, OK with that
pass
# Clean up web server SSE spot/alert queues
self.web_server.clean_up_sse_queues()
self.status = "OK"
self.last_cleanup_time = datetime.now(pytz.UTC)