From 6938a8cc0a77215db363df5215076760128a7a4b Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Fri, 5 Jun 2026 16:17:29 +0100 Subject: [PATCH] SSE server reliability improvements --- server/handlers/api/alerts.py | 4 ++-- server/handlers/api/spots.py | 4 ++-- 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, 26 insertions(+), 26 deletions(-) diff --git a/server/handlers/api/alerts.py b/server/handlers/api/alerts.py index daa7d80..e41b7dd 100644 --- a/server/handlers/api/alerts.py +++ b/server/handlers/api/alerts.py @@ -102,7 +102,7 @@ class APIAlertsStreamHandler(tornado_eventsource.handler.EventSourceHandler): self.write_message("keepalive", "") except Exception as e: - logging.warning("Exception when serving SSE socket", e) + logging.warning("Exception when serving SSE socket: %s", e, exc_info=True) self.close() def close(self): @@ -144,7 +144,7 @@ class APIAlertsStreamHandler(tornado_eventsource.handler.EventSourceHandler): logging.error("Web server cleared up a queue of an active connection!") self.close() except: - logging.warning("Exception in SSE callback, connection will be closed.") + logging.warning("Exception in SSE callback, connection will be closed: %s", e, exc_info=True) self.close() diff --git a/server/handlers/api/spots.py b/server/handlers/api/spots.py index b9998db..9141b53 100644 --- a/server/handlers/api/spots.py +++ b/server/handlers/api/spots.py @@ -104,7 +104,7 @@ class APISpotsStreamHandler(tornado_eventsource.handler.EventSourceHandler): self.write_message("keepalive", "") except Exception as e: - logging.warning("Exception when serving SSE socket", e) + logging.warning("Exception when serving SSE socket: %s", e, exc_info=True) self.close() def close(self): @@ -146,7 +146,7 @@ class APISpotsStreamHandler(tornado_eventsource.handler.EventSourceHandler): logging.error("Web server cleared up a queue of an active connection!") self.close() except: - logging.warning("Exception in SSE callback, connection will be closed.") + logging.warning("Exception in SSE callback, connection will be closed: %s", e, exc_info=True) self.close() diff --git a/templates/about.html b/templates/about.html index 880d5a7..7dac68d 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 3c381e4..80fdc18 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 fdd06a3..c9dc8ed 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 c10ac5a..a672224 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 aa73c85..a874d0a 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 8f31986..660c3f8 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -271,8 +271,8 @@
- - + + diff --git a/templates/map.html b/templates/map.html index a144d9b..334d8d5 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 02ffb57..38cd070 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 fc8028f..a38542c 100644 --- a/templates/status.html +++ b/templates/status.html @@ -59,8 +59,8 @@ - - + +