diff --git a/core/cleanup.py b/core/cleanup.py index 3a82fa8..6610d5d 100644 --- a/core/cleanup.py +++ b/core/cleanup.py @@ -35,7 +35,7 @@ class CleanupTimer: self._stop_event.set() if self._thread: - self._thread.join(timeout=15) + self._thread.join(timeout=5) if self._thread.is_alive(): logger.warning("Cleanup worker thread did not exit on time and will be killed.") diff --git a/core/data_providers.py b/core/data_providers.py index 06423ee..289b1b7 100644 --- a/core/data_providers.py +++ b/core/data_providers.py @@ -91,7 +91,7 @@ class DataProviders: for t in threads: t.start() - deadline = time.monotonic() + 40 + deadline = time.monotonic() + 15 for t in threads: t.join(timeout=max(0.0, deadline - time.monotonic())) still_running = [t for t in threads if t.is_alive()] diff --git a/providers/alert/http_alert_provider.py b/providers/alert/http_alert_provider.py index a06dd45..eee3b52 100644 --- a/providers/alert/http_alert_provider.py +++ b/providers/alert/http_alert_provider.py @@ -33,7 +33,7 @@ class HTTPAlertProvider(AlertProvider): def stop(self): self._stop_event.set() if self._thread: - self._thread.join(timeout=35) + self._thread.join(timeout=12) if self._thread.is_alive(): logger.warning(f"{self.name} alert worker thread did not exit on time and will be killed.") diff --git a/providers/callsigndata/file_download_callsign_data_provider.py b/providers/callsigndata/file_download_callsign_data_provider.py index 0663ea9..6016ce2 100644 --- a/providers/callsigndata/file_download_callsign_data_provider.py +++ b/providers/callsigndata/file_download_callsign_data_provider.py @@ -38,7 +38,7 @@ class FileDownloadCallsignDataProvider(CallsignDataProvider): def stop(self): self._stop_event.set() if self._thread: - self._thread.join(timeout=35) + self._thread.join(timeout=12) if self._thread.is_alive(): logger.warning(f"{self.name} callsign data worker thread did not exit on time and will be killed.") diff --git a/providers/sigrefdata/file_download_sig_ref_data_provider.py b/providers/sigrefdata/file_download_sig_ref_data_provider.py index d1e243b..48677f4 100644 --- a/providers/sigrefdata/file_download_sig_ref_data_provider.py +++ b/providers/sigrefdata/file_download_sig_ref_data_provider.py @@ -33,7 +33,7 @@ class FileDownloadSIGRefDataProvider(SIGRefDataProvider): def stop(self): super().stop() if self._thread: - self._thread.join(timeout=35) + self._thread.join(timeout=12) if self._thread.is_alive(): logger.warning(f"{self.sig_name} SIG ref data worker thread did not exit on time and will be killed.") diff --git a/providers/solarconditions/giroionosonde.py b/providers/solarconditions/giroionosonde.py index 4067920..1c08618 100644 --- a/providers/solarconditions/giroionosonde.py +++ b/providers/solarconditions/giroionosonde.py @@ -73,7 +73,7 @@ class GIROIonosonde(SolarConditionsProvider): def stop(self): self._stop_event.set() if self._thread: - self._thread.join(timeout=35) + self._thread.join(timeout=12) if self._thread.is_alive(): logger.warning("GIRO ionosonde worker thread did not exit on time and will be killed.") diff --git a/providers/solarconditions/http_solar_conditions_provider.py b/providers/solarconditions/http_solar_conditions_provider.py index a5feeb9..f889fc1 100644 --- a/providers/solarconditions/http_solar_conditions_provider.py +++ b/providers/solarconditions/http_solar_conditions_provider.py @@ -31,7 +31,7 @@ class HTTPSolarConditionsProvider(SolarConditionsProvider): def stop(self): self._stop_event.set() if self._thread: - self._thread.join(timeout=35) + self._thread.join(timeout=12) if self._thread.is_alive(): logger.warning(f"{self.name} solar conditions worker thread did not exit on time and will be killed.") diff --git a/providers/solarconditions/kc2gprop.py b/providers/solarconditions/kc2gprop.py index 8f9cd81..a678bbe 100644 --- a/providers/solarconditions/kc2gprop.py +++ b/providers/solarconditions/kc2gprop.py @@ -38,7 +38,7 @@ class KC2GProp(SolarConditionsProvider): def stop(self): self._stop_event.set() if self._thread: - self._thread.join(timeout=35) + self._thread.join(timeout=12) if self._thread.is_alive(): logger.warning("KC2G ionosonde worker thread did not exit on time and will be killed.") diff --git a/providers/spot/aprsis.py b/providers/spot/aprsis.py index cc4be2a..8be74b7 100644 --- a/providers/spot/aprsis.py +++ b/providers/spot/aprsis.py @@ -49,7 +49,7 @@ class APRSIS(SpotProvider): if self._aprsis: self._aprsis.close() if self._thread: - self._thread.join(timeout=15) + self._thread.join(timeout=5) if self._thread.is_alive(): logger.warning("APRS-IS worker thread did not exit on time and will be killed.") diff --git a/providers/spot/dxcluster.py b/providers/spot/dxcluster.py index 7ff26bb..9a4d17f 100644 --- a/providers/spot/dxcluster.py +++ b/providers/spot/dxcluster.py @@ -1,5 +1,6 @@ import logging import re +import socket from datetime import datetime from threading import Event, Lock, Thread @@ -52,9 +53,13 @@ class DXCluster(SpotProvider): self._stop_event.set() with self._telnet_lock: if self._telnet: + try: + self._telnet.sock.shutdown(socket.SHUT_RDWR) + except (AttributeError, OSError): + pass self._telnet.close() if self._thread: - self._thread.join(timeout=15) + self._thread.join(timeout=5) if self._thread.is_alive(): logger.warning(f"DX Cluster {self._hostname} worker thread did not exit on time and will be killed.") diff --git a/providers/spot/http_spot_provider.py b/providers/spot/http_spot_provider.py index f71f81f..88f7dde 100644 --- a/providers/spot/http_spot_provider.py +++ b/providers/spot/http_spot_provider.py @@ -35,7 +35,7 @@ class HTTPSpotProvider(SpotProvider): self._stop_event.set() self._wakeup_event.set() if self._thread: - self._thread.join(timeout=35) + self._thread.join(timeout=12) if self._thread.is_alive(): logger.warning(f"{self.name} spot worker thread did not exit on time and will be killed.") diff --git a/providers/spot/rbn.py b/providers/spot/rbn.py index 28b3261..580652c 100644 --- a/providers/spot/rbn.py +++ b/providers/spot/rbn.py @@ -1,5 +1,6 @@ import logging import re +import socket from datetime import datetime from threading import Event, Lock, Thread @@ -41,9 +42,13 @@ class RBN(SpotProvider): self._stop_event.set() with self._telnet_lock: if self._telnet: + try: + self._telnet.sock.shutdown(socket.SHUT_RDWR) + except (AttributeError, OSError): + pass self._telnet.close() if self._thread: - self._thread.join(timeout=15) + self._thread.join(timeout=5) if self._thread.is_alive(): logger.warning(f"RBN (port {self._port!s}) worker thread did not exit on time and will be killed.") diff --git a/providers/spot/sse_spot_provider.py b/providers/spot/sse_spot_provider.py index 1b3f93b..a83f9a3 100644 --- a/providers/spot/sse_spot_provider.py +++ b/providers/spot/sse_spot_provider.py @@ -42,7 +42,7 @@ class SSESpotProvider(SpotProvider): logger.exception(f"Exception closing SSE connection for {self.name} during stop()") if self._thread: - self._thread.join(timeout=15) + self._thread.join(timeout=5) if self._thread.is_alive(): logger.warning(f"{self.name} SSE worker thread did not exit on time and will be killed.") diff --git a/providers/spot/websocket_spot_provider.py b/providers/spot/websocket_spot_provider.py index 5c5af61..528d3e7 100644 --- a/providers/spot/websocket_spot_provider.py +++ b/providers/spot/websocket_spot_provider.py @@ -34,7 +34,7 @@ class WebsocketSpotProvider(SpotProvider): if self._ws: self._ws.close() if self._thread: - self._thread.join(timeout=15) + self._thread.join(timeout=5) if self._thread.is_alive(): logger.warning(f"{self.name} websocket worker thread did not exit on time and will be killed.") diff --git a/providers/staticdata/file_download_static_data_provider.py b/providers/staticdata/file_download_static_data_provider.py index 6b733f6..4b31b3d 100644 --- a/providers/staticdata/file_download_static_data_provider.py +++ b/providers/staticdata/file_download_static_data_provider.py @@ -35,7 +35,7 @@ class FileDownloadStaticDataProvider(StaticDataProvider): def stop(self): self._stop_event.set() if self._thread: - self._thread.join(timeout=35) + self._thread.join(timeout=12) if self._thread.is_alive(): logger.warning(f"{self.name} static data worker thread did not exit on time and will be killed.") diff --git a/templates/add_spot.html b/templates/add_spot.html index c233fd3..3d29a6e 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -77,7 +77,7 @@ - + diff --git a/templates/alerts.html b/templates/alerts.html index de10240..e1a3a6a 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -83,7 +83,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index 43d706e..2db0f03 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -76,8 +76,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index f04449b..8a8db97 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -16,10 +16,10 @@ window.fetchEventSource = fetchEventSource; - - - - + + + + {% end %} {% block body %}
diff --git a/templates/conditions.html b/templates/conditions.html index 7253f75..288d27d 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -284,7 +284,7 @@
- + diff --git a/templates/map.html b/templates/map.html index 49287ac..e3130ba 100644 --- a/templates/map.html +++ b/templates/map.html @@ -113,8 +113,8 @@ const CARTODB_API_KEY = "{{ web_ui_options.get('cartodb_api_key', '') }}"; - - + + diff --git a/templates/spots.html b/templates/spots.html index b4e8110..e268d64 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -125,8 +125,8 @@ - - + + diff --git a/templates/status.html b/templates/status.html index aeb8d7e..42e60b7 100644 --- a/templates/status.html +++ b/templates/status.html @@ -96,7 +96,7 @@ - +