From f6622bb942bb619fe94d81b59ee6a9f6a1d6cb61 Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Fri, 5 Jun 2026 16:15:10 +0100 Subject: [PATCH] SSE server reliability improvements --- server/handlers/api/alerts.py | 1 + server/handlers/api/spots.py | 1 + templates/about.html | 2 +- templates/add_spot.html | 4 ++-- templates/alerts.html | 4 ++-- templates/bands.html | 6 +++--- templates/base.html | 8 ++++---- templates/conditions.html | 4 ++-- templates/map.html | 6 +++--- templates/spots.html | 6 +++--- templates/status.html | 4 ++-- 11 files changed, 24 insertions(+), 22 deletions(-) diff --git a/server/handlers/api/alerts.py b/server/handlers/api/alerts.py index a48e1fb..daa7d80 100644 --- a/server/handlers/api/alerts.py +++ b/server/handlers/api/alerts.py @@ -103,6 +103,7 @@ class APIAlertsStreamHandler(tornado_eventsource.handler.EventSourceHandler): except Exception as e: logging.warning("Exception when serving SSE socket", e) + self.close() def close(self): """When the user closes the socket, empty our queue and remove it from the list so the server no longer fills it""" diff --git a/server/handlers/api/spots.py b/server/handlers/api/spots.py index 6117752..b9998db 100644 --- a/server/handlers/api/spots.py +++ b/server/handlers/api/spots.py @@ -105,6 +105,7 @@ class APISpotsStreamHandler(tornado_eventsource.handler.EventSourceHandler): except Exception as e: logging.warning("Exception when serving SSE socket", e) + self.close() def close(self): """When the user closes the socket, empty our queue and remove it from the list so the server no longer fills it""" diff --git a/templates/about.html b/templates/about.html index e4f42be..880d5a7 100644 --- a/templates/about.html +++ b/templates/about.html @@ -69,7 +69,7 @@

This software is dedicated to the memory of Tom G1PJB, SK, a friend and colleague who sadly passed away around the time I started writing it in Autumn 2025. I was looking forward to showing it to you when it was done.

- + {% end %} \ No newline at end of file diff --git a/templates/add_spot.html b/templates/add_spot.html index 922d2d9..3c381e4 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -69,8 +69,8 @@ - - + + {% end %} \ No newline at end of file diff --git a/templates/alerts.html b/templates/alerts.html index 7f3fee5..fdd06a3 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -70,8 +70,8 @@ - - + + {% end %} \ No newline at end of file diff --git a/templates/bands.html b/templates/bands.html index fb0c9c6..c10ac5a 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -76,9 +76,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 6f11114..aa73c85 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -19,9 +19,9 @@ integrity="sha384-L1eE4eD41kpBIWe2I0eHy+GnEUC4RIpcvibVW2JCminuPlTl+2Bc528iPdVMg5Dn" crossorigin="anonymous"> - - - + + + {% end %} {% block body %}
diff --git a/templates/conditions.html b/templates/conditions.html index a3201ca..8f31986 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -271,8 +271,8 @@
- - + + diff --git a/templates/map.html b/templates/map.html index 21c9ed4..a144d9b 100644 --- a/templates/map.html +++ b/templates/map.html @@ -94,9 +94,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/spots.html b/templates/spots.html index f876ab4..02ffb57 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -104,9 +104,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/status.html b/templates/status.html index a10c38f..fc8028f 100644 --- a/templates/status.html +++ b/templates/status.html @@ -59,8 +59,8 @@ - - + +