Partial fix for mypy issues

This commit is contained in:
Ian Renton
2026-09-20 20:42:16 +01:00
parent 93ea27510f
commit 203758fa2d
25 changed files with 244 additions and 147 deletions
+7 -6
View File
@@ -3,6 +3,7 @@ from __future__ import annotations
import logging
import threading
import time
from collections.abc import Sequence
from typing import TYPE_CHECKING
from core.config import config, create_provider_from_config
@@ -48,7 +49,7 @@ class DataProviders:
@staticmethod
def start_providers(
providers: list[
providers: Sequence[
SpotProvider | AlertProvider | SolarConditionsProvider | StaticDataProvider | ActivityRefDataProvider | CallsignDataProvider
],
provider_type: str,
@@ -108,13 +109,13 @@ class DataProviders:
logger.exception("Exception stopping provider")
threads = [threading.Thread(target=stop_provider, args=(p,), daemon=True) for p in all_providers]
for t in threads:
t.start()
for thread in threads:
thread.start()
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()]
for thread in threads:
thread.join(timeout=max(0.0, deadline - time.monotonic()))
still_running = [thread for thread in threads if thread.is_alive()]
if still_running:
logger.warning("Some threads did not stop in time!")