First attempt at SSE backend #3

This commit is contained in:
Ian Renton
2025-12-22 12:20:32 +00:00
parent 81da836bae
commit befaceb2f5

View File

@@ -26,7 +26,6 @@ cleanup_timer = None
# Shutdown function
def shutdown(sig, frame):
global spot_providers, alert_providers, cleanup_timer, spots, alerts
logging.info("Stopping program, this may take a few seconds...")
for p in spot_providers:
if p.enabled:
@@ -56,7 +55,6 @@ def get_alert_provider_from_config(config_providers_entry):
# Utility method to add a spot, notifying the web server in case any Server-Sent Event connections need to have data
# sent immediately. If the spot has already expired due to loading old data, it will be ignored.
def add_spot(spot):
global web_server
if not spot.expired():
spots.add(spot.id, spot, expire=MAX_SPOT_AGE)
if web_server:
@@ -65,7 +63,6 @@ def add_spot(spot):
# Utility method to add an alert, notifying the web server in case any Server-Sent Event connections need to have data
# sent immediately. If the alert has already expired due to loading old data, it will be ignored.
def add_alert(alert):
global web_server
if not alert.expired():
alerts.add(alert.id, alert, expire=MAX_SPOT_AGE)
if web_server: