Поправил типы

This commit is contained in:
2026-02-21 22:53:52 +03:00
parent f5bb681ddb
commit b2442f4d91
8 changed files with 11 additions and 11 deletions

View File

@@ -9,8 +9,8 @@ from typing import Any, Optional
from .log_manager import LogManager
class ConfigManager:
DEFAULT_UPDATE_INTERVAL = 5.0
DEFAULT_WORK_INTERVAL = 2.0
DEFAULT_UPDATE_INTERVAL = 5
DEFAULT_WORK_INTERVAL = 2
def __init__(self, path: str, log_manager: Optional[LogManager] = None):
self.path = path

View File

@@ -18,7 +18,7 @@ class TelegramControlChannel(ControlChannel):
self,
token: str,
chat_id: int,
poll_interval: float = 2.0,
poll_interval: int = 2,
logger: Optional[logging.Logger] = None,
):
"""Инициализация канала опроса Telegram с настройками бота и чата."""

View File

@@ -22,8 +22,8 @@ from .scheduler import WorkerLoop
class ConfigManagerV2:
DEFAULT_UPDATE_INTERVAL = 5.0
DEFAULT_WORK_INTERVAL = 2.0
DEFAULT_UPDATE_INTERVAL = 5
DEFAULT_WORK_INTERVAL = 2
def __init__(
self,

View File

@@ -12,7 +12,7 @@ class WorkerLoop:
def __init__(
self,
execute: Callable[[], None],
get_interval: Callable[[], float],
get_interval: Callable[[], int | float],
halt_event: asyncio.Event,
on_error: Optional[Callable[[Exception], None]] = None,
on_success: Optional[Callable[[], None]] = None,

View File

@@ -17,7 +17,7 @@ class HealthAggregator:
get_state: Callable[[], LifecycleState],
get_last_error: Callable[[], str | None],
get_last_success_timestamp: Callable[[], float | None],
health_timeout: float,
health_timeout: int,
get_app_health: Callable[[], HealthPayload],
):
self._get_state = get_state

View File

@@ -25,7 +25,7 @@ class ManagementServer:
self,
host: str,
port: int,
timeout: float,
timeout: int,
health_provider: Callable[[], Awaitable[HealthPayload]],
on_start: Optional[Callable[[], Awaitable[str]]] = None,
on_stop: Optional[Callable[[], Awaitable[str]]] = None,

View File

@@ -32,9 +32,9 @@ class ManagementServerSettings:
enabled: bool = False
host: str = "0.0.0.0"
port: int = 8000
timeout: float = 3.0
timeout: int = 3
"""Таймаут запроса health (секунды)."""
health_timeout: float = 30.0
health_timeout: int = 30
"""Секунды без успешного execute(), после которых health = unhealthy."""